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

Fix span processor exporting unsampled spans #871

Merged

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Sep 2, 2022

Currently span processors will send span data to exporters even if the sampled flag is false. This patch fixes this by explicitly checking the sampled state in both the batch and simple span processors.

Fixes #870

Currently span processors will send span data to exporters even if the
sampled flag is false. This patch fixes this by explicitly checking the
sampled state in both the batch and simple span processors.
@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Base: 66.8% // Head: 66.6% // Decreases project coverage by -0.1% ⚠️

Coverage data is based on head (922afaf) compared to base (0e6e67e).
Patch coverage: 25.0% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #871     +/-   ##
=======================================
- Coverage   66.8%   66.6%   -0.2%     
=======================================
  Files        113     113             
  Lines       8775    8798     +23     
=======================================
- Hits        5866    5864      -2     
- Misses      2909    2934     +25     
Impacted Files Coverage Δ
opentelemetry-sdk/src/trace/span_processor.rs 77.7% <10.0%> (-4.3%) ⬇️
opentelemetry-sdk/src/testing/trace.rs 70.5% <100.0%> (+1.1%) ⬆️
opentelemetry-api/src/context.rs 82.9% <0.0%> (-6.0%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

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

the logic LGTM. Maybe better if we have some unit tests to prevent regression in the future?

@jtescher
Copy link
Member Author

jtescher commented Sep 5, 2022

@TommyCpp added a regression test 👍

@jtescher jtescher merged commit ffe1fbb into open-telemetry:main Sep 6, 2022
@jtescher jtescher deleted the fix-span-processor-sampled-bug branch September 6, 2022 17:52
@TommyCpp
Copy link
Contributor

TommyCpp commented Sep 6, 2022

Sorry took a look yesterday but forgot to approve

@jtescher
Copy link
Member Author

jtescher commented Sep 6, 2022

@TommyCpp All good, thanks for the review 🥳

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.

Exporters should not be sent "is_sampled=false" spans
2 participants