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

Select instrumentation libraries via OTEL_DOTNET_AUTO_*_INSTRUMENTATION_ENABLED #1633

Closed
pellared opened this issue Nov 17, 2022 · 5 comments · Fixed by #2088
Closed

Select instrumentation libraries via OTEL_DOTNET_AUTO_*_INSTRUMENTATION_ENABLED #1633

pellared opened this issue Nov 17, 2022 · 5 comments · Fixed by #2088
Assignees
Milestone

Comments

@pellared
Copy link
Member

pellared commented Nov 17, 2022

Instead of OTEL_DOTNET_AUTO_[SIGNAL]_ENABLED_INSTRUMENTATIONS and OTEL_DOTNET_AUTO_[SIGNAL]_DISABLED_INSTRUMENTATIONS we could support OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED like the OTel Java Agent does.

I think it may be good to be consistent with Java.

If we agree on it we should first try to bring it to the https://github.com/open-telemetry/opentelemetry-specification.

@pellared pellared changed the title Selecting instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Selecting instrumentations via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Nov 17, 2022
@pellared pellared changed the title Selecting instrumentations via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Selecting instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Nov 17, 2022
@pellared pellared changed the title Selecting instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Enable instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Nov 17, 2022
@pellared pellared changed the title Enable instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Select instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Nov 17, 2022
@pellared
Copy link
Member Author

Another reason to have OTEL_INSTRUMENTATION_[NAME]_ENABLED instead of env var which accepts a CSV value is that it is easier to create "layers" with Dockerfiles, K8s configuration, or even copy/paste snippets to e.g. disable some instrumentation library.

There is also a proposal to have a pattern OTEL_DOTNET_AUTO_[SIGNAL]_INSTRUMENTATION_[NAME]_ENABLED to be more precise.

@pellared
Copy link
Member Author

pellared commented Nov 17, 2022

@dmitryax shared with me a clean proposal (which he also recommends to try to add into the OTel Spec):

OTEL_INSTRUMENTATION_ENABLED=true|false for everything
OTEL_DOTNET_INSTRUMENTATION_ENABLED=true|false for all .NET instrumentation libraries
OTEL_DOTNET_TRACES_INSTRUMENTATION_ENABLED=true|false for all .NET tracing instrumentation libraries
OTEL_DOTNET_TRACES_[lib-name]_INSTRUMENTATION_ENABLED=true|false for one .NET instrumentation library.

So if the user wants all the instrumentation except for GraphQL tracing instrumentation:

OTEL_DOTNET_TRACES_GRAPHQL_INSTRUMENTATION_ENABLED=false

If the user wants to enable only GraphQL tracing instrumentation:

OTEL_INSTRUMENTATION_ENABLED=false
OTEL_DOTNET_TRACES_GRAPHQL_INSTRUMENTATION_ENABLED=true

He suggests avoiding having both ENABLED and DISABLED env vars.

@pellared pellared added this to the 0.5.2 milestone Nov 23, 2022
@pellared
Copy link
Member Author

@pellared
Copy link
Member Author

@carlosalberto discussed it with the OTel spec SIG and/or with OTel Config WG. There is not agreement that these env vars should land into to OTel Spec until the OTel Config Spec becomes more mature. Therefore, we should add the OTEL_DOTNET_AUTO prefix and probably mark these env vars as experimental as maybe this will be addressed later in OTel Config Spec.

Therefore my current proposal is to have:

OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLED=true|false for all .NET instrumentation libraries.
OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLED=true|false for all .NET traces instrumentation libraries.
OTEL_DOTNET_AUTO_TRACES_[lib-name]_INSTRUMENTATION_ENABLED=true|false for one .NET traces instrumentation library.

@pellared pellared changed the title Select instrumentation libraries via OTEL_INSTRUMENTATION_[NAME]_ENABLED and OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED Select instrumentation libraries via OTEL_DOTNET_AUTO_*_INSTRUMENTATION_ENABLED Jan 18, 2023
@mateuszrzeszutek
Copy link
Member

Oops, forgot about this issue. FYI @trask, this might be something we want to approach in the javaagent too.

OTEL_DOTNET_TRACES_INSTRUMENTATION_ENABLED=true|false for all .NET tracing instrumentation libraries
OTEL_DOTNET_TRACES_[lib-name]_INSTRUMENTATION_ENABLED=true|false for one .NET instrumentation library.

On the Java side of things, we don't really differentiate between tracing/metrics/any-other-signal instrumentation - it's a whole package, you either get everything or have to configure views/samplers that filter particular data out. (Which I think is kinda the point of OpenTelemetry, to have correlated different signals)

Oh, and I like the OTEL_INSTRUMENTATION_ENABLED - it's a bit terser than the javaagent's OTEL_INSTRUMENTATION_DEFAULT_ENABLED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants