RUM-8051: Implement Head-based sampling for network instrumentation#2483
Merged
0xnm merged 1 commit intoJan 16, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2483 +/- ##
===========================================
+ Coverage 69.92% 70.01% +0.09%
===========================================
Files 788 788
Lines 29604 29647 +43
Branches 4944 4961 +17
===========================================
+ Hits 20698 20756 +58
+ Misses 7527 7520 -7
+ Partials 1379 1371 -8
|
0xnm
force-pushed
the
nogorodnikov/rum-8051/implement-head-based-sampling
branch
from
January 13, 2025 15:35
ac37341 to
4ee9caa
Compare
xgouchet
approved these changes
Jan 14, 2025
jonathanmos
approved these changes
Jan 14, 2025
0xnm
force-pushed
the
nogorodnikov/rum-8051/implement-head-based-sampling
branch
from
January 15, 2025 16:16
4ee9caa to
8852339
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR implements Head-based sampling for the network instrumentation to align with default sampling existing in other Datadog tracers.
In short, Head-based sampling (HBS) allows to have a single sampling decision for the whole trace: it is kept or dropped, instead of the individual spans.
This also aligns with the following changes in iOS SDK done in the past:
Now, if there is a parent span (propagated through the headers or via request tag; OpenTracing or OpenTelemetry), then its sampling decision will be taken into account instead of the sampling decision made by the network instrumentation.
If there is no parent tracing context for the incoming request, then sampling decision will be made by interceptor.
The necessary integration tests are added, they uncovered some issues we had with trace propagation.
Also this PR bring the following change: spans with
DROPsampling decision are not written, they are rejected by the intake anyway, so it makes no sense to send them.Review checklist (to be filled by reviewers)