[entities] Specifying entity information via an environment variable#4594
[entities] Specifying entity information via an environment variable#4594jsuereth merged 4 commits intoopen-telemetry:mainfrom
Conversation
86c5007 to
22fb619
Compare
|
I am really puzzled by this. The declarative configuration project was done to declare all the configuration in a structured document, in yaml, because this could not fit into environment variables, which have limitations for complex objects. And here, an environment variable is used, that contains a structured document with yet another internal syntax, to model an arbitrary complex object. Complex resources can be already described, for example: Please clarify why we need |
|
This implements the original OTEP https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/entities/0264-resource-and-entities.md#environment-variable-detector This doesn't mean that this is the only way to pass entities to the SDKs. We should definitely support defining entities in the config schema. However, we still need to provide an alternative (read as replacement) for Are we sure that the config interface can be used in any possible environment and for any SDK where the env vars are supported? |
|
@open-telemetry/operator-approvers do you see any problems with passing this env var to the SDKs instead of |
|
As far as I understand the current design decision is that in order to add a new env variable we need to be sure that it would interoperate well with declarative config: I do not say that it means that ideas behind the OTEP is wrong. Moreover, I think the idea is to also add configuration capabilities to declarative configuration first. CC @open-telemetry/configuration-approvers |
If I understand correctly:
Now, from a project management perspective:
However, the data provided by this new environment variable is not just a string. It will take to implement a parser for the new document format, in every SIG SDK, to support it. This is putting more load on each SIG, because now things have to be done twice, and differently. [Edit 2025-07-24] Options are:
Something for the TC to discuss I guess. IF the decision comes to have an environment variable added, then, The sooner every SIG supports declarative configuration, the better, so we won't have this arbitration to do for each proposed change. [End of Edit 2025-07-24] Once this PR is merged in specs, it would be good to see a sibling PR to support entities in declarative configuration, because we can not afford to maintain two diverging branches about two diverging ways to provide configuration, and we can not afford to hinder adoption of declarative configuration because a new environment variable only feature is available, preventing migration. |
|
@marcalff From the Spec call last Tuesday (29/07/25): file configuration and environment variables are considered orthogonal for this specific Entity scenario, and thus this new variable should be supported (and specifically required by cloud vendors). |
|
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
e4fe57b to
e86ea16
Compare
ffa4874 to
3533891
Compare
dyladan
left a comment
There was a problem hiding this comment.
In general I think the format, parsing, and handling work well. What I wonder is why it is specified differently than other entity detectors? We have been moving as a SIG towards specifying entities more similar to other signals with a clear split between API and SDK, and "instrumentation-like" entity detectors which call API methods. Is there a reason for this ENV behavior to be built into the SDK outside of that paradigm? Can't this be just another entity detector, possibly enabled by default? Advantages of that approach would be that users can set precedence using the same mechanisms they do for other entity detectors and other SDKs may benefit from the same component.
|
/cc @RohitRanjanMS in case you're interested - this maybe relevant for Azure Functions as a future way to provide resource (entity) information along with declarative configuration. |
Add a document on how to inject entity information into workloads using new environment variable OTEL_ENTITIES.
3533891 to
9efeb89
Compare
3b0dd36 to
c941e30
Compare
### Entities - Specify entity information via an environment variable. ([#4594](#4594)) ### Common - OTLP Exporters may allow devs to prepend a product identifier in `User-Agent` header. ([#4560](#4560)) -⚠️ **IMPORTANT**: Extending the set of standard attribute value types is no longer a breaking change. ([#4614](#4614)) ### OTEPs - Clarify in Composite Samplers OTEP the unreliable threshold case. ([#4569](#4569)) --------- Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com>
Add a document on how to inject entity information into workloads using new environment variable
OTEL_ENTITIES.Related issue: #4140
Related OTEP: https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/entities/0264-resource-and-entities.md