-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Describe the bug
Enabling the AWS resource provider when running the Java agent by setting otel.resource.providers.aws.enabled=true disables all builtint resource providers, including the one which sets resource attributes from the environment variable OTEL_RESOURCE_ATTRIBUTES.
I that that if I use the setting otel.java.enabled.resource.providers that all the builtin providers are disabled except for the ones specified, and that is documented as such just fine.
However, this seems to apply to the otel.resource.providers.<name>.enabled settings as-well, enabling one of them also disables all other default providers.
IMO, this is not made sufficiently clear in the documentation, where it says that "you can enable additional resource providers".
Steps to reproduce
Run a Java application with the Java agent and set the following environment variables:
OTEL_RESOURCE_ATTRIBUTES=foo=bar
OTEL_RESOURCE_PROVIDERS_AWS_ENABLE=trueIn the emitted telemetry, the resource foo can not be seen because the io.opentelemetry.sdk.autoconfigure.EnvironmentResourceProvider was disabled.
Expected behavior
I would expect to retain all the default providers when I use a setting of the form otel.resource.providers.<name>.enabled.
Alternatively, the documentation can be clarified that enabling resource providers via the otel.resource.providers.<name>.enabled setting does in fact disable all the default ones.
Actual behavior
See description above.
Javaagent or library instrumentation version
2.18.1
Environment
JDK: 21
OS: Tested on Windows 11 and Amazon Linux
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.