Skip to content

[processor/tailsamplingprocessor] move spans during ingest instead of copying#48971

Draft
csmarchbanks wants to merge 1 commit into
open-telemetry:mainfrom
csmarchbanks:tailsampling-move-spans
Draft

[processor/tailsamplingprocessor] move spans during ingest instead of copying#48971
csmarchbanks wants to merge 1 commit into
open-telemetry:mainfrom
csmarchbanks:tailsampling-move-spans

Conversation

@csmarchbanks

Copy link
Copy Markdown
Contributor

Description

Reduce the amount of allocations done by the tail sampling processor by using MoveTo when possible. This requires marking the processor as mutating data which will cause any fanout setups to still copy the data but shows ~10-15% improvement in allocations for users without a fanout.

Link to tracking issue

Testing

this change is transparent so all existing tests need to pass

Documentation

no documentation

Authorship

  • I, a human, wrote this pull request description myself.

… copying

Mark the processor as MutatesData=true and switch the per-span CopyTo to MoveTo
when assembling per-trace ResourceSpans. The framework's fanoutconsumer handles
fanout topologies via an upstream clone; in single-consumer pipelines the
per-span deep copy becomes a pointer swap. Updates three concurrency/integrity
tests that previously reused the input td across ConsumeTraces calls.

Assisted-by: Claude Opus 4.7
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.

1 participant