diff --git a/newrelic_perfmon_plugin/Agent.cs b/newrelic_perfmon_plugin/Agent.cs index 12d9dee..91ba9a4 100644 --- a/newrelic_perfmon_plugin/Agent.cs +++ b/newrelic_perfmon_plugin/Agent.cs @@ -52,6 +52,7 @@ public override void PollCycle() try { Scope.Connect(); + var metricNames = new Dictionary(); foreach (Dictionary counter in Counters) { @@ -89,6 +90,15 @@ public override void PollCycle() string metricName = string.Format("{0}{2}/{1}", categoryName, counterName, instanceName); + if (metricNames.ContainsKey(metricName)) + { + metricName = metricName + "#" + metricNames[metricName]++; + } + else + { + metricNames.Add(metricName, 1); + } + logger.Debug("{0}/{1}: {2} {3}", Name, metricName, value, unitValue); ReportMetric(metricName, unitValue, value);