Skip to content

Conversation

@isaacaflores2
Copy link
Contributor

@isaacaflores2 isaacaflores2 commented Jan 15, 2026

Overview

This PR updates the span enrichment to clear the span id and span name. This allows the span id and name to be only represented by the elastic attributes (span.id, span.name or transaction.id , transaction.name) only. The ES Exporter can then use both the elastic attributes and the SpanID and SpanName in the ECS encoder and the resulting document will contain the correct attributes based on the enrichment applied in the elasticapmprocessor/opentelemetry-lib.

The clear_span_id and clear_span_name configs are disabled by default for backwards compatibility. Collectors that do not require strict parity with the apm-data flow can keep these configs disabled (example should be the EDOT collectors). Collectors that would like to closely match the apm-data behavior can enable these configs as needed.

Related to: open-telemetry/opentelemetry-collector-contrib#45014 and elastic/opentelemetry-collector-components#943

Testing

  • Updated unit
  • Spin up local collector with es exporter to validate indexed documents. Example processor/elasticapm config:
processor:
 elasticapm:
        elastic_span:
          clear_span_id:
            enabled: true
          clear_span_name:
            enabled: true
        elastic_transaction:
          clear_span_id:
            enabled: true
          clear_span_name:
            enabled: true

This allows the span id and name to be only represented by the elastic attributes (`span.id`, `span.name` or `transaction.id` , `transaction.name`) only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants