From a21ca80f4d3a3771b6276b64bbac72755cf3c542 Mon Sep 17 00:00:00 2001 From: Doug Hoard Date: Mon, 28 Oct 2024 23:44:06 -0400 Subject: [PATCH] Disable auto exclude (#1023) Signed-off-by: dhoard --- .../java/io/prometheus/jmx/ObjectNameAttributeFilter.java | 5 ++++- .../io/prometheus/jmx/ObjectNameAttributeFilterTest.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/collector/src/main/java/io/prometheus/jmx/ObjectNameAttributeFilter.java b/collector/src/main/java/io/prometheus/jmx/ObjectNameAttributeFilter.java index f8317853..eba7eb6f 100644 --- a/collector/src/main/java/io/prometheus/jmx/ObjectNameAttributeFilter.java +++ b/collector/src/main/java/io/prometheus/jmx/ObjectNameAttributeFilter.java @@ -20,7 +20,6 @@ import io.prometheus.jmx.logger.LoggerFactory; import java.util.Collections; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -61,6 +60,7 @@ private ObjectNameAttributeFilter() { */ private ObjectNameAttributeFilter initialize(Map yamlConfig) throws MalformedObjectNameException { + /* if (yamlConfig.containsKey(EXCLUDE_OBJECT_NAME_ATTRIBUTES)) { Map objectNameAttributeMap = (Map) yamlConfig.get(EXCLUDE_OBJECT_NAME_ATTRIBUTES); @@ -84,6 +84,9 @@ private ObjectNameAttributeFilter initialize(Map yamlConfig) } else { autoExcludeObjectNameAttributes = true; } + */ + + autoExcludeObjectNameAttributes = false; LOGGER.log(Level.FINE, "dynamicExclusion [%b]", autoExcludeObjectNameAttributes); diff --git a/collector/src/test/java/io/prometheus/jmx/ObjectNameAttributeFilterTest.java b/collector/src/test/java/io/prometheus/jmx/ObjectNameAttributeFilterTest.java index 1650b01c..31328d1d 100644 --- a/collector/src/test/java/io/prometheus/jmx/ObjectNameAttributeFilterTest.java +++ b/collector/src/test/java/io/prometheus/jmx/ObjectNameAttributeFilterTest.java @@ -6,9 +6,11 @@ import java.util.*; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; +import org.junit.Ignore; import org.junit.Test; import org.yaml.snakeyaml.Yaml; +@Ignore @SuppressWarnings({"unchecked", "rawtypes"}) public class ObjectNameAttributeFilterTest {