opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Introduce span type field

Open thompson-tomo opened this issue 1 month ago • 4 comments

What are you trying to achieve?

I want my traces to have a predictable well-known identity so that I can easily do:

  • filtering of traces
  • Transforming traces into metrics

Another key use case raised by @jsuereth on a couple of occasions is weaver live check needing an id to identify the model. I suspect the same need would also apply to the collector schema transformer.

Initial implementation thoughts Introduce a new field on span span_type which can be set to the model ie db.sql_server.client which is defined in semconv.

Additional context. For consistency with metrics & events we would go with span name but that field is already taken hence opting for type which is consistent with entities.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

thompson-tomo avatar Nov 15 '25 07:11 thompson-tomo

can you give some examples of what values span type might take on? How is this different than span kind?

jkwatson avatar Nov 15 '25 16:11 jkwatson

@jkwatson have updated the description. Span kind can't act as the identity.

thompson-tomo avatar Nov 16 '25 01:11 thompson-tomo

can you give some examples of what values span type might take on? How is this different than span kind?

Elastic APM uses span.type and span.subtype. Here are some examples of how it's used: https://ci-artifacts.kibana.dev/storybooks/main/apm_ui_shared/index.html?path=/story/shared-spanicon--list

(this effort doesn't come from Elastic, but it's the same concept.)

smith avatar Nov 21 '25 16:11 smith

Agree in this case the otel type would be a concatenation span.type + span.subtype

thompson-tomo avatar Nov 23 '25 09:11 thompson-tomo