Description
What are you trying to achieve?
The Collector SIG is planning to add attributes to the Collector's internal telemetry to identify which component instance within the Collector emitted the telemetry. For practical reasons, instrumentation scopes were thought to be the most appropriate attribute collection to include these "component attributes" in. (For more context, see this Collector issue and this Go SIG issue.)
As discussed in the Spec SIG meeting on 2025-03-11, instrumentation scopes are generally used to separate telemetry at the source code level (ie. which library emitted it, and which version thereof). On the other hand, our component attributes are defined at runtime, based on the Collector's configuration, and may be applied to telemetry from multiple instrumentation libraries. However, because they stay static after the instantiation of the Collector pipeline, the general consensus seemed to be that our use case would fall within the intended semantics of scope attributes.
However, there are still a number of places in the specification that imply a narrow, source-level definition of instrumentation scopes:
- The Glossary defines a scope as "a logical unit of the application code", and states that "since the scope is a build-time concept the attributes of the scope cannot change at runtime."
- The Log, Trace, and Metric API definitions all link to the glossary entry, and mention "the instrumentation scope, such as the instrumentation library, package, module or class."
(The docs page about scopes under "Concepts" uses very similar language, but that one is not in the specification proper.)
It's possible that nothing strictly normative prevents the use of runtime-defined scopes or scope attributes, but we believe it would be good to loosen the language regarding instrumentation scopes, and perhaps even add an example to endorse use cases similar to ours.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status