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

Env var resource configuration should be RECOMMENDED and not optional

Open lmolkova opened this issue 11 months ago • 3 comments

What are you trying to achieve?

I'd like to be able to configure common OTel resource attributes via environment variables in the same way across different languages. Currently env var configuration is completely optional:

https://github.com/open-telemetry/opentelemetry-specification/blob/4f71c1642e541220e293bacf8c0d58f1fbcd3111/specification/configuration/sdk-environment-variables.md?plain=1#L15

At the same time some env vars are supported by virtually all SDKs:

https://github.com/open-telemetry/opentelemetry-specification/blob/ff66b248d5f746651008fb87ce7d672d12991a96/spec-compliance-matrix.md#environment-variables

This is problematic when configuring polyglot applications, writing docs for native instrumentations, etc.

Having OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES as RECOMMENDED would solve most of my concerns.

Additional context.

See also https://github.com/open-telemetry/opentelemetry.io/issues/4059, https://github.com/open-telemetry/opentelemetry-cpp/issues/2559

lmolkova avatar Mar 07 '24 22:03 lmolkova

Agree with this. However, this will be useful only if spec also clarifies ENV or code takes precedence. That does not seem to enforced by spec, leading to each languages doing it in-consistently.

cijothomas avatar Mar 12 '24 15:03 cijothomas

Removing from the file configuration project as this is not related to file configuration. There is currently no general purpose configuration project board.

jack-berg avatar May 16 '24 20:05 jack-berg

@jack-berg in our triage meetings we've added a couple things to the file config board like this that aren't specifically about the config format but are a use case that needs to be considered. It also has a dependency on file config before it can be worked on. We didn't really have another place to put it.

dyladan avatar May 21 '24 02:05 dyladan