Skip to content

Commit

Permalink
Disable actuator instrumentation by default (#10394)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Feb 3, 2024
1 parent ed041f6 commit e47be09
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 e47be09

Please sign in to comment.