diff --git a/collector/src/main/java/io/prometheus/jmx/JmxCollector.java b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java index ebb1eca4..6c0e5e98 100644 --- a/collector/src/main/java/io/prometheus/jmx/JmxCollector.java +++ b/collector/src/main/java/io/prometheus/jmx/JmxCollector.java @@ -581,7 +581,7 @@ public void recordBean( attributeName = attrName; } - String matchName = beanName + attributeName + ": " + matchBeanValue; + String matchName = (beanName + attributeName + ": " + matchBeanValue).intern(); if (rule.cache) { MatchedRule cachedRule = config.rulesCache.get(rule, matchName);