Skip to content

Resource creation race condition with OTEL_RESOURCE_ATTRIBUTES env var #5054

@xrmx

Description

@xrmx

Users cannot assume that you can use OTEL_RESOURCE_ATTRIBUTES to override some resource attributes created by another resource detector because all the attributes collections by resource detectors are delegated to a thread pool, OTEL_RESOURCE_ATTRIBUTES included. The attributes are collected from the env var by OTELResourceDetector (otel entry point).

To make things simpler for users (like being able to override a value collected by a resource detector) we can probably put OTELResourceDetector out of the thread pool since it's not doing anything i/o bound or cpu intensitive and have it override any eventual duplicated collected attributes.
This may clash with the idea that all stable attributes are collected by OTELResourceDetector so another option would be to just move the collection of attributes from env vars out of resource detectors. Doing that will remove the ability to ignore env vars though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions