Skip to content

Commit

Permalink
Disable actuator instrumentation by default (open-telemetry#10394)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored and steverao committed Feb 16, 2024
1 parent c4fd454 commit d3a8f2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ tasks.withType<Test>().configureEach {
// required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")

jvmArgs("-Dotel.instrumentation.spring-boot-actuator-autoconfigure.enabled=true")
}

val latestDepTest = findProperty("testLatestDeps") as Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.internal.injection.ClassInjector;
import io.opentelemetry.javaagent.extension.instrumentation.internal.injection.InjectionMode;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

Expand Down Expand Up @@ -62,4 +63,10 @@ public void injectClasses(ClassInjector injector) {
public List<TypeInstrumentation> typeInstrumentations() {
return singletonList(new AutoConfigurationImportSelectorInstrumentation());
}

@Override
public boolean defaultEnabled(ConfigProperties config) {
// produces a lot of metrics that are already captured - e.g. JVM memory usage
return false;
}
}

0 comments on commit d3a8f2a

Please sign in to comment.