opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

Environment Variables to align with other OpenTelemetry SDKs

Open EStork09 opened this issue 2 years ago • 3 comments

Feature Request

Is your feature request related to a problem?

We are using opentelemetry to auto instrument some prepackaged applications that we don't have the ability to instrument the code base. We have some headers that are being sent that would be valuable for us to be able to have added to the spans via environment variables like other libraries have currently. (OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS)

Describe the solution you'd like:

Allow environment variables to be set to capture http headers. OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS is an example but referencing the java agent configuration

Describe alternatives you've considered.

Other monitoring solutions?

Additional Context

In the dotnet instrumentation repo I opened up an issue and was redirected here #2874

EStork09 avatar Sep 13 '23 18:09 EStork09

I'm trying some proofs of concept with OpenTelemetry .NET Automatic Instrumentation and this would be really useful, for example to be able to display database statements by enabling the option via environment variable, without requiring changes in our application code like this: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient#advanced-configuration

Similar as requested here if I'm not mistaken: open-telemetry/opentelemetry-dotnet-contrib#1770 Thanks

vsbs-david avatar Sep 15 '23 07:09 vsbs-david

The env var should have a OTEL_DOTNET_ prefix. Reference https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#language-specific-environment-variables

pellared avatar Sep 15 '23 07:09 pellared

@pellared Is there an env var for db statement?

zszepczynski avatar Sep 27 '23 10:09 zszepczynski

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

github-actions[bot] avatar Mar 11 '25 03:03 github-actions[bot]

Closed as inactive. Feel free to reopen if this issue is still a concern.

github-actions[bot] avatar Mar 18 '25 03:03 github-actions[bot]