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 trace kIsSampled flag set incorrectly #1465

Merged
merged 4 commits into from
Jul 1, 2022
Merged

Conversation

luyor
Copy link
Contributor

@luyor luyor commented Jun 27, 2022

Fixes trace_flags.kIsSampled is set to true if sample_results.desicion!=DROP, but it should be true only if sample_results.desicion==RECORD_AND_SAMPLE.

Similar logic can be found in golang opentelemetry sdk: https://github.com/open-telemetry/opentelemetry-go/blob/ef6c0da0de3b39c20a753354446807d7577aca61/sdk/trace/tracer.go#L104

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@luyor luyor requested a review from a team June 27, 2022 06:21
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 27, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@luyor luyor closed this Jun 27, 2022
@luyor luyor reopened this Jun 27, 2022
@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #1465 (071bdbf) into main (7b0bb14) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1465      +/-   ##
==========================================
+ Coverage   85.30%   85.31%   +0.02%     
==========================================
  Files         154      154              
  Lines        4374     4377       +3     
==========================================
+ Hits         3731     3734       +3     
  Misses        643      643              
Impacted Files Coverage Δ
sdk/include/opentelemetry/sdk/trace/sampler.h 100.00% <100.00%> (ø)
sdk/src/trace/tracer.cc 90.25% <100.00%> (ø)

@lalitb
Copy link
Member

lalitb commented Jun 27, 2022

Thanks for the fix. LGTM, can you fix the format to enable CI to pass - https://github.com/open-telemetry/opentelemetry-cpp/blob/main/CONTRIBUTING.md#how-to-send-pull-requests

@luyor
Copy link
Contributor Author

luyor commented Jun 28, 2022

Thanks for the fix. LGTM, can you fix the format to enable CI to pass - https://github.com/open-telemetry/opentelemetry-cpp/blob/main/CONTRIBUTING.md#how-to-send-pull-requests

Format is fixed. Thanks for reviewing.

@lalitb lalitb merged commit 4c08919 into open-telemetry:main Jul 1, 2022
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