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

Only send userid in Dynamic Sampling Context if sendDefaultPii is true #2147

Conversation

adinauer
Copy link
Member

📜 Description

See getsentry/develop#625

💡 Motivation and Context

Replaces #2145 and not only skips userId in baggage but also in the envelope header trace.

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2022

Codecov Report

Merging #2147 (d7bf614) into feat/add-sample-rate-to-baggage (685c725) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                        Coverage Diff                         @@
##             feat/add-sample-rate-to-baggage    #2147   +/-   ##
==================================================================
  Coverage                              80.94%   80.94%           
- Complexity                              3288     3290    +2     
==================================================================
  Files                                    233      233           
  Lines                                  12041    12044    +3     
  Branches                                1595     1594    -1     
==================================================================
+ Hits                                    9746     9749    +3     
  Misses                                  1712     1712           
  Partials                                 583      583           
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/TraceContext.java 86.74% <100.00%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 685c725...d7bf614. Read the comment docs.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -500,6 +501,29 @@ class SentryTracerTest {
}
}

@Test
fun `returns trace state without userId if not send pii`() {
Copy link
Member

Choose a reason for hiding this comment

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

l: For full conditional coverage you could also add a test if the user is null and isSendDefaultPii = true, but maybe that's overkill. Up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

added returns baggage header without userId if send pii and null user below

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

@adinauer adinauer merged commit 30e4ed6 into feat/add-sample-rate-to-baggage Jul 1, 2022
@adinauer adinauer deleted the feat/skip-userid-in-dsc-if-not-sending-pii branch July 1, 2022 11:40
adinauer added a commit that referenced this pull request Jul 1, 2022
…atten user (#2135)

* Add sample rate to baggage and trace in envelope header; flatten user

* Add changelog

* Use _ for baggage keys

* Commit tests

* Feat/traces sampler into sample rate (#2141)

* Commit tests

* Add sample rate from traces sampler to DSC

* Do not replace null with true/false

* Restore sample rate in OutboxSender

* Remove fallback for sampling decision from TraceContext

* Remove sample rate fallback from TracesSamplingDecision

* Test more envelope header trace fields for OutboxSender

* CR changes

* Fix changelog

* Only send userid in Dynamic Sampling Context if sendDefaultPii is true (#2147)

* Skip sending userId in DSC if send default pii is off

* Add changelog

* Add test case
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

3 participants