-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The SDK MUST extract information from the OTEL_RESOURCE_ATTRIBUTES environment variable #1689
The SDK MUST extract information from the OTEL_RESOURCE_ATTRIBUTES environment variable #1689
Comments
I think this will also apply to |
From what I can tell the environment resource detector is not included in the default: opentelemetry-go/sdk/resource/resource.go Line 43 in 8b1be11
But, there would still be a problem if it was that the user supplied resource to an SDK would not be merged with the environment attributes. Instead it would overwrite or clear them: opentelemetry-go/sdk/trace/provider.go Lines 198 to 201 in 8b1be11
|
@Aneurysm9 Can I take this issue? |
@Aneurysm9 I'd like to take this issue |
Currently we do not default to including attributes specified with the
OTEL_RESOURCE_ATTRIBUTES
environment variable. This is required by the specification:These attributes will be used to create a Resource if
resource.New
is used to create a resource passed to an SDK, but it must be done by the user.The
TracerProvider
and metricController
need to be updated to default extracting these attributes into a resource that is merged with theresource.Default
resource they already use.Having these attributes automatically merged into the used resource makes the
FromEnv
detector of limited value. It would only include attributes that would latter be merged in. It seems like that detector should be removed, or possibly changed to accept a list of environment variable names that it would then pull in as attributes of a Resource. Meaning if you wanted to specify a Resource in a way other than defined for theOTEL_RESOURCE_ATTRIBUTES
environment variable you could accomplish it that way.The text was updated successfully, but these errors were encountered: