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(dynamic-sampling): Do not freeze DSC if no Sentry values are present #532

Merged
merged 5 commits into from Jan 18, 2023

Conversation

tonyo
Copy link
Member

@tonyo tonyo commented Jan 17, 2023

From https://develop.sentry.dev/sdk/performance/dynamic-sampling-context/#freezing-dynamic-sampling-context:

When an SDK receives an HTTP request that was "instrumented" or "traced" by a Sentry SDK, the receiving SDK should consider the incoming DSC as instantly frozen. Any values on the DSC should be propagated "as is" - this includes values like "environment" or "release".

SDKs should recognize incoming requests as "instrumented" or "traced" when at least one of the following applies:
The incoming request has a sentry-trace header
The incoming request has a baggage header containing one or more keys starting with "sentry-"

Therefore, when creating a DSC from a header, let's freeze it only when there's at least one sentry- value.

@tonyo tonyo requested a review from cleptric January 17, 2023 12:35
@codecov
Copy link

codecov bot commented Jan 17, 2023

Codecov Report

Base: 83.75% // Head: 83.86% // Increases project coverage by +0.11% 🎉

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

❗ Current head ade23ec differs from pull request most recent head 25bddf6. Consider uploading reports for the commit 25bddf6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
+ Coverage   83.75%   83.86%   +0.11%     
==========================================
  Files          23       23              
  Lines        2801     2802       +1     
==========================================
+ Hits         2346     2350       +4     
+ Misses        374      370       -4     
- Partials       81       82       +1     
Impacted Files Coverage Δ
dynamic_sampling_context.go 93.42% <100.00%> (+4.08%) ⬆️
tracing.go 82.26% <100.00%> (+1.72%) ⬆️
integrations.go 89.01% <0.00%> (-2.32%) ⬇️
transport.go 78.37% <0.00%> (-0.85%) ⬇️

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.

@tonyo tonyo merged commit 808b6d3 into master Jan 18, 2023
@tonyo tonyo deleted the tonyo/fix-dsc-freezing-when-empty branch January 18, 2023 18:03
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.

None yet

2 participants