improve log message for namespace collision

This commit is contained in:
Jonathan Shook 2024-07-31 14:22:10 -05:00
parent 4f22bf113d
commit d0efb5f07b

View File

@ -38,7 +38,8 @@ public class NBBaseComponentMetrics implements NBComponentMetrics {
lock.lock(); lock.lock();
String openMetricsName = metric.getLabels().linearizeAsMetrics(); String openMetricsName = metric.getLabels().linearizeAsMetrics();
if (metrics.containsKey(openMetricsName)) { if (metrics.containsKey(openMetricsName)) {
throw new RuntimeException("Can't add the same metric by label set to the same live component:" + openMetricsName); throw new RuntimeException("Can't add the same metric by label set to the same live component:" +
" this:" + this.toString());
} }
metrics.put(openMetricsName,metric); metrics.put(openMetricsName,metric);
for (MetricRegistryListener listener : listeners) { for (MetricRegistryListener listener : listeners) {