Permalink
Browse files

fixed lack of per-instance instrumentation in aggregator/relay

  • Loading branch information...
cdavis committed Sep 30, 2011
1 parent 18235e2 commit 4942299a24bb4026015f80142a1180276a3622ff
Showing with 9 additions and 4 deletions.
  1. +9 −4 carbon/lib/carbon/instrumentation.py
@@ -126,18 +126,23 @@ def cache_record(metric, value):
if settings.instance is None:
fullMetric = 'carbon.agents.%s.%s' % (HOSTNAME, metric)
else:
- fullMetric = 'carbon.agents.%s-%s.%s' % (
- HOSTNAME, settings.instance, metric)
+ fullMetric = 'carbon.agents.%s-%s.%s' % (HOSTNAME, settings.instance, metric)
datapoint = (time.time(), value)
cache.MetricCache.store(fullMetric, datapoint)
def relay_record(metric, value):
- fullMetric = 'carbon.relays.%s.%s' % (HOSTNAME, metric)
+ if settings.instance is None:
+ fullMetric = 'carbon.relays.%s.%s' % (HOSTNAME, metric)
+ else:
+ fullMetric = 'carbon.relays.%s-%s.%s' % (HOSTNAME, settings.instance, metric)
datapoint = (time.time(), value)
events.metricGenerated(fullMetric, datapoint)
def aggregator_record(metric, value):
- fullMetric = 'carbon.aggregator.%s.%s' % (HOSTNAME, metric)
+ if settings.instance is None:
+ fullMetric = 'carbon.aggregator.%s.%s' % (HOSTNAME, metric)
+ else:
+ fullMetric = 'carbon.aggregator.%s-%s.%s' % (HOSTNAME, settings.instance, metric)
datapoint = (time.time(), value)
events.metricGenerated(fullMetric, datapoint)

0 comments on commit 4942299

Please sign in to comment.