Skip to content

Commit

Permalink
Merge pull request #1821 from newrelic/saxon/otel-sdk-kill-switch
Browse files Browse the repository at this point in the history
Add a switch to allow the OTel SDK integration to be completely disabled
  • Loading branch information
jtduffy authored Apr 1, 2024
2 parents 5665423 + 2a1a397 commit 4060a06
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ public class AutoConfiguredOpenTelemetrySdk {

public static AutoConfiguredOpenTelemetrySdkBuilder builder() {
final AutoConfiguredOpenTelemetrySdkBuilder builder = Weaver.callOriginal();
NewRelic.getAgent().getLogger().log(Level.INFO, "Appending OpenTelemetry SDK customizers");
builder.addPropertiesCustomizer(new PropertiesCustomizer());
builder.addResourceCustomizer(new ResourceCustomer());
Boolean autoConfigure = NewRelic.getAgent().getConfig().getValue("opentelemetry.sdk.autoconfigure.enabled");
if (autoConfigure == null || autoConfigure) {
NewRelic.getAgent().getLogger().log(Level.INFO, "Appending OpenTelemetry SDK customizers");
builder.addPropertiesCustomizer(new PropertiesCustomizer());
builder.addResourceCustomizer(new ResourceCustomer());
}
return builder;
}
}

0 comments on commit 4060a06

Please sign in to comment.