Constant OTEL_COMPONENT_NAME
pub const OTEL_COMPONENT_NAME: &'static str;
Expand description
A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
§Notes
Implementations SHOULD ensure a low cardinality for this attribute, even across application or SDK restarts. E.g. implementations MUST NOT use UUIDs as values for this attribute.
Implementations MAY achieve these goals by following a [otel.component.type]/[instance-counter]
pattern, e.g. batching_span_processor/0
.
Hereby otel.component.type
refers to the corresponding attribute value of the component.
The value of instance-counter
MAY be automatically assigned by the component and uniqueness within the enclosing SDK instance MUST be guaranteed.
For example, [instance-counter]
MAY be implemented by using a monotonically increasing counter (starting with 0
), which is incremented every time an
instance of the given component type is started.
With this implementation, for example the first Batching Span Processor would have batching_span_processor/0
as otel.component.name
, the second one batching_span_processor/1
and so on.
These values will therefore be reused in the case of an application restart.
§Examples
"otlp_grpc_span_exporter/0"
"custom-name"