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: Create a frozen DSC when calling ToBaggage #566

Merged
merged 4 commits into from
Feb 2, 2023
Merged

Conversation

cleptric
Copy link
Member

@cleptric cleptric commented Feb 2, 2023

This fixes an issue, where someone would call span.ToBaggage to fetch the DynamicSamplingContext to attach it to an outgoing HTTP request "baggage" header or to render it in an HTML template as a "baggage" meta tag before the transaction is finished.

We need to freeze the DynamicSamplingContext in such cases, as any mutations after the DynamicSamplingContext was propagated to a downstream SDK mess up DynamicSampling.

@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Base: 74.71% // Head: 74.72% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (97203de) compared to base (fb76180).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #566   +/-   ##
=======================================
  Coverage   74.71%   74.72%           
=======================================
  Files          38       38           
  Lines        3837     3838    +1     
=======================================
+ Hits         2867     2868    +1     
  Misses        850      850           
  Partials      120      120           
Impacted Files Coverage Δ
otel/propagator.go 91.66% <100.00%> (-0.44%) ⬇️
tracing.go 87.91% <100.00%> (+0.13%) ⬆️

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.

@cleptric cleptric enabled auto-merge (squash) February 2, 2023 12:41
@cleptric cleptric merged commit d0a2aa3 into master Feb 2, 2023
@cleptric cleptric deleted the fix-to-baggage branch February 2, 2023 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants