Opentelemetry-specification: Clarify exported span attribute precedence

Created on 17 Jun 2020  路  9Comments  路  Source: open-telemetry/opentelemetry-specification

If a span has an attribute set which will generally also be added by an exporter (e.g. span.kind), currently exporters in many languages will end up with both values being reported. We should clarify the expected behavior here, e.g. should some attribute names be reserved and filtered out of the attribute set? Should both values be reported? Should the attribute-defined value be taken and the span value be ignored?

sdk after-ga trace

Most helpful comment

Rather than defining a precedence for overwriting values I would avoid this situation beforehand by introducing _reserved_ attribute keys for all first-class citizens (span name, kind, status, ...) to the spec.

All 9 comments

Exporters are expected to get read-only data. Maybe you are referring to SpanProcessors?

@carlosalberto I think this is about conventions for translating OTel span data to non-OT protocols that don't have dedicated fields for e.g. the span kind. These exporters would presumably translate the span kind into some attribute. The question now is, what should happen if an attribute with that key already exists?

@Oberon00 exactly. For example should the Jaeger exporter chose the span kind or the attribute named span.kind if they differ?

Rather than defining a precedence for overwriting values I would avoid this situation beforehand by introducing _reserved_ attribute keys for all first-class citizens (span name, kind, status, ...) to the spec.

That makes a lot of sense IMHO.

Rather than defining a precedence for overwriting values I would avoid this situation beforehand by introducing reserved attribute keys for all first-class citizens (span name, kind, status, ...) to the spec.

It will be hard to reserve all possible values, for any random protocol that exists, for example are we going to reserve all attributes for datadog, dynatrace, jaege, lightstep, splunk, x-ray, zipkin, etc.? Probably not, so a more scalable solution should be implemented for this.

We would not be reserving names for protocol-specific fields, but for things that a span conceptually contains according to the OpenTelemetry span API specification.

@Oberon00 and let's say Span.Kind which is a concept in OpenTelemetry what are you going to reserve? span.kind why? is that not a OpenTracing convention, why not kind?

It will get bad very soon.

@bogdandrutu "span.kind" sounds reasonable as a reserved attribute for protocols/data models that don't support a native Kind of a Span. In this particular case, OpenTracing happens to have their own semantic convention "span.kind" already matching OpenTelemetry's first-class Span.Kind, so that should be fine.
Otherwise, prefixing it with otel like we have for "otel.instrumentation_library.name" and "otel.instrumentation_library.version" in the Zipkin and Jaeger exporter spec would be safer to avoid collisions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pavolloffay picture pavolloffay  路  4Comments

cijothomas picture cijothomas  路  3Comments

XSAM picture XSAM  路  3Comments

bogdandrutu picture bogdandrutu  路  4Comments

iNikem picture iNikem  路  4Comments