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

Feat/traces sampler into sample rate #2141

Merged

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Jun 28, 2022

#skip-changelog

📜 Description

Addon PR for #2135 to also include the result of tracesSampler callback in case it was used.

💡 Motivation and Context

Requried for Dynamic Sampling

💚 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

@adinauer adinauer changed the base branch from main to feat/add-sample-rate-to-baggage June 28, 2022 10:31
@philipphofmann
Copy link
Member

Maybe it makes sense that you, @brustolin, have a look at this PR on a conceptual level.

@@ -1521,14 +1525,15 @@ public class io/sentry/SpanContext : io/sentry/JsonSerializable, io/sentry/JsonU
protected field status Lio/sentry/SpanStatus;
protected field tags Ljava/util/Map;
public fun <init> (Lio/sentry/SpanContext;)V
Copy link
Member Author

Choose a reason for hiding this comment

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

Regarding breaking changes to constructors here:
Duplicating the constructors would still break when explicitly passing null as the compiler then doesn't know which version to call. So a cast would be needed to fix. That's why we decided to just modify the constructors and risk breaking stuff this way as they are niche constructors which we expect to not be used by many and it's a rather easy fix to pass a new TracesSamplingDecision(true/false) instead of the boolean.

@adinauer adinauer marked this pull request as ready for review June 29, 2022 08:21
@adinauer adinauer requested a review from romtsn as a code owner June 29, 2022 08:21
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2022

Codecov Report

❗ No coverage uploaded for pull request base (feat/add-sample-rate-to-baggage@076ba00). Click here to learn what that means.
The diff coverage is n/a.

@@                        Coverage Diff                         @@
##             feat/add-sample-rate-to-baggage    #2141   +/-   ##
==================================================================
  Coverage                                   ?   80.94%           
  Complexity                                 ?     3288           
==================================================================
  Files                                      ?      233           
  Lines                                      ?    12041           
  Branches                                   ?     1595           
==================================================================
  Hits                                       ?     9746           
  Misses                                     ?     1712           
  Partials                                   ?      583           

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 076ba00...87f91f8. Read the comment docs.

@adinauer adinauer merged commit db695a4 into feat/add-sample-rate-to-baggage Jun 30, 2022
@adinauer adinauer deleted the feat/traces-sampler-into-sample-rate branch June 30, 2022 10:16
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

5 participants