Skip to content

Commit eb2ef5f

Browse files
committed
Alter instrumentation suppression behavior
1 parent a886cc9 commit eb2ef5f

File tree

1 file changed

+4
-10
lines changed
  • javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config

1 file changed

+4
-10
lines changed

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/config/AgentConfig.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@ public final class AgentConfig {
1111

1212
public static boolean isInstrumentationEnabled(
1313
ConfigProperties config, Iterable<String> instrumentationNames, boolean defaultEnabled) {
14-
// If default is enabled, we want to enable individually,
15-
// if default is disabled, we want to disable individually.
16-
boolean anyEnabled = defaultEnabled;
1714
for (String name : instrumentationNames) {
1815
String propertyName = "otel.instrumentation." + name + ".enabled";
19-
boolean enabled = config.getBoolean(propertyName, defaultEnabled);
20-
21-
if (defaultEnabled) {
22-
anyEnabled &= enabled;
23-
} else {
24-
anyEnabled |= enabled;
16+
Boolean enabled = config.getBoolean(propertyName);
17+
if (enabled != null) {
18+
return enabled;
2519
}
2620
}
27-
return anyEnabled;
21+
return defaultEnabled;
2822
}
2923

3024
public static boolean isDebugModeEnabled(ConfigProperties config) {

0 commit comments

Comments
 (0)