Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/tailsampling] Minor rework to improve performance #37560

Merged
merged 7 commits into from
Jan 29, 2025

Conversation

portertech
Copy link
Contributor

@portertech portertech commented Jan 28, 2025

This pull-request reworks the consume traces, sampling decision, and policy loading paths to improve performance and readability. Pressing the current architecture for the best results, by reducing allocations and calls when sensible.

The makeDecision() changes alone resulted in a noticeable improvement, using the existing benchmark:

Sampling-8 16.37µ ± 2% 10.96µ ± 3% -33.02% (p=0.000 n=10)

Signed-off-by: Sean Porter <portertech@gmail.com>
…lls, less branching

Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
@github-actions github-actions bot added the processor/tailsampling Tail sampling processor label Jan 28, 2025
@github-actions github-actions bot requested a review from jpkrohling January 28, 2025 22:04
Signed-off-by: Sean Porter <portertech@gmail.com>
…revert policies

Signed-off-by: Sean Porter <portertech@gmail.com>
@portertech portertech marked this pull request as ready for review January 28, 2025 22:36
@portertech portertech requested a review from a team as a code owner January 28, 2025 22:36
Signed-off-by: Sean Porter <portertech@gmail.com>
Signed-off-by: Sean Porter <portertech@gmail.com>
Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great -- the context.Background was a great catch!

@jpkrohling jpkrohling merged commit 1666327 into open-telemetry:main Jan 29, 2025
163 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 29, 2025
chengchuanpeng pushed a commit to chengchuanpeng/opentelemetry-collector-contrib that referenced this pull request Feb 8, 2025
…lemetry#37560)

This pull-request reworks the consume traces, sampling decision, and
policy loading paths to improve performance and readability. Pressing
the current architecture for the best results, by reducing allocations
and calls when sensible.

The `makeDecision()` changes alone resulted in a noticeable improvement,
using the existing benchmark:

`Sampling-8   16.37µ ± 2%   10.96µ ± 3%  -33.02% (p=0.000 n=10)`

---------

Signed-off-by: Sean Porter <portertech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/tailsampling Tail sampling processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants