Merge "Fix error logs in prometheus w/o prometheus annotations." into stable/queens

This commit is contained in:
Zuul 2018-03-12 09:19:49 +00:00 committed by Gerrit Code Review
commit bd1bc077c5
1 changed files with 2 additions and 1 deletions

View File

@ -273,7 +273,7 @@ class Prometheus(checks.AgentCheck):
if len(ports) == 1 and not endpoints:
self.log.info("Could not find matching port using only port "
"configured")
endpoints.append("{}/{}".format(ports[pod_index], prometheus_endpoint))
endpoints.append("{}/{}".format(ports[0][pod_index], prometheus_endpoint))
if not endpoints:
self.log.error("Can not derive which port to use. Due to either "
@ -281,6 +281,7 @@ class Prometheus(checks.AgentCheck):
"configured and none of them selected via "
"configurations. "
"{} {} skipped for scraping".format(self.detect_method, name))
self.log.debug("Found prometheus endpoints '{}'".format(endpoints))
return endpoints
def _send_metrics(self, metric_families, dimensions, endpoint_whitelist, endpoint_metric_types,