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.
Users cannot assume that you can use
OTEL_RESOURCE_ATTRIBUTESto 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_ATTRIBUTESincluded. The attributes are collected from the env var byOTELResourceDetector(otelentry point).To make things simpler for users (like being able to override a value collected by a resource detector) we can probably put
OTELResourceDetectorout 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
OTELResourceDetectorso 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.