Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider some way (env. variable/property?) to disable autoconfiguration or force a "Opentelemetry.noop()" instance #4483

Closed
evantorrie opened this issue May 19, 2022 · 2 comments · Fixed by #4489
Labels
Feature Request Suggest an idea for this project

Comments

@evantorrie
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I have applications that are manually instrumented using the Java Otel API but also include the Autoconfiguration SDK extension class so that it's easy to configure the SDK via environment variables and '-D' switches.

However, there are times when we want to completely disable OpenTelemetry (e.g. to check whether any issues in our application are caused by OpenTelemetry, or compare performance with/without OpenTelemetry enabled).

For auto-instrumentation via the javaagent, there is a single "kill switch", namely -Dotel.javaagent.enabled=false that disables any SDK initialization, etc. However, there is no equivalent for disabling autoconfiguration SDK completely if the "autoconfiguration" SDK extension class exists on the application classpath.

Describe the solution you'd like

A property or environment variable that can be used to disable OpenTelemetry autoconfiguration completely, e.g. -Dotel.autoconfiguration.enabled=false.

Describe alternatives you've considered
Even if we have our own flag to prevent any calls to the Otel autoconfigure API, any library we include which makes use of GlobalOpenTelemetry.get() will end up autoconfiguring the Otel SDK if the autoconfig extension class exists. By default, the autoconfigured SDK is a "working" SDK with OTLP exporters enabled for metrics and traces, rather than a "noop" OpenTelemetry instance.

Additional context
This issue was brought up at the May 10th 2022 Java SIG meeting. https://docs.google.com/document/d/1WK9h4p55p8ZjPkxO75-ApI9m0wfea6ENZmMoFRvXSCw/edit#heading=h.wtapn135xim7

@evantorrie evantorrie added the Feature Request Suggest an idea for this project label May 19, 2022
@evantorrie evantorrie changed the title Consider a method (env. variable/property) to disable autoconfiguration Consider some way (env. variable/property?) to disable autoconfiguration or force a "Opentelemetry.noop()" instance May 19, 2022
@jack-berg
Copy link
Member

I'd like to prototype this in java, and then open up an issue in the specification to formalize this.

I propose adding otel.experimental.enabled=true|false, where "experimental" would go away if / when this is accepted to the specification.

@jkwatson
Copy link
Contributor

I'd like to prototype this in java, and then open up an issue in the specification to formalize this.

I propose adding otel.experimental.enabled=true|false, where "experimental" would go away if / when this is accepted to the specification.

maybe, otel.experimental.sdk.enabled ? Since the API/Context/Context propagation will still work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants