Skip to content

Endorse use of runtime-defined instrumentation scope attributes #4450

Closed
@jade-guiton-dd

Description

@jade-guiton-dd

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

spec:miscellaneousFor issues that don't match any other spec labeltriage:accepted:readyReady to be implemented. Small enough or uncontroversial enough to be implemented without sponsor

Type

No type

Projects

Status

Spec - Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions