Skip to content

Commit

Permalink
Merge pull request #62 from pkarkazis/master
Browse files Browse the repository at this point in the history
add label on monitoring container
  • Loading branch information
pkarkazis authored Dec 2, 2019
2 parents 6fb0341 + 39eeb89 commit 30eb277
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cnf_mon/prompw.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def __init__(self, pw_url_,node_name_, id_, logger_):
def sendGauge(self,metric, description ,value, job, labels):
for g in self.metrics:
if g._name == metric and g._type == 'gauge':
g.labels(container_name=self.id,stats_ip=labels['ip'],stats_port=labels['port']).set(value)
g.labels(container=self.id, container_name=self.id,stats_ip=labels['ip'],stats_port=labels['port']).set(value)
self.push(job=job)
return

g = Gauge(metric, description , ["container_name","stats_ip","stats_port"], registry=self.registry)
g.labels(container_name=self.id,stats_ip=labels['ip'],stats_port=labels['port']).set(value)
g = Gauge(metric, description , ["container","container_name","stats_ip","stats_port"], registry=self.registry)
g.labels(container=self.id, container_name=self.id,stats_ip=labels['ip'],stats_port=labels['port']).set(value)
self.metrics.append(g)
self.push(job=job)

Expand Down

0 comments on commit 30eb277

Please sign in to comment.