Skip to content

Allow to enable/disable (automatic) OpenTelemetry tracing dynamically #9257

Open
@sergeykad

Description

@sergeykad

Is your feature request related to a problem? Please describe.
We are worried about the potential performance impact of using OpenTelemetry and would like to be able to enable/disable it as needed without application restarts.

Describe the solution you'd like
An option to replace Tracer used by GlobalOpenTelemetry from the regular tracer to a no-op tracer should do the trick. For example something like GlobalOpenTelemetry.get().disable().

Describe alternatives you've considered
It probably can be implemented as an extension, but I am not sure how, and it feels that it should be part of the standard API. There is no easy way to replace Tracer, so maybe it can be done with a custom Sampler implementation. However, I am not sure how I can enable/disable it at runtime.

Additional context
https://github.com/open-telemetry/community/discussions/1048
#5972
#3389

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked on specificationNeeds specification work before this can be resolvedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions