Skip to content

Conversation

@isaacaflores2
Copy link
Contributor

Overview

Traditional APM event ingestion utilized enrichment from the apm-data lib. With the introduction of the receiver/elasticapmintake component (which is using apm-data internally) it is possible for a collector to have a pipeline such as: receiver/elasticapmintake -> processor/elasticapm.

The processor/elasticapm and the opentelemetry-lib should account for this by not overriding any pre-existing elastic attributes. This will preserve the existing values and avoid any unintended changes to elastic attributes

This is a follow up to #237

Changes

  • Added attribute.IsEmpty helper function which checks if an attribute exists or is empty. I opted to use this approach since in some it allows the logic to exit early when the attribute exists. The downside is that it adds a lot more if statements everywhere.
    • The alternative would be to add a wrapper around Attributes().PutStr but this would require the enrichment logic to always attempt to derive the new value which would be a little less efficient.
  • Updated all enrichment logic to only set an attribute if it does not exists or is empty
    • The logic around transaction.type required special consideration since the library itself can set the transaction.type
  • Updated isElasticTransaction to check processor.event. This avoids having to derive if a span is an elastic transaction when it is already explicitly considered a transactions. It also avoids reclassifying a span to a transaction or a transaction to a span.

@isaacaflores2 isaacaflores2 requested review from a team, gregkalapos and lahsivjar December 4, 2025 20:53
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