-
Notifications
You must be signed in to change notification settings - Fork 399
[APMAPI-1258] Adjust trace sampling formula #4616
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4616 +/- ##
==========================================
- Coverage 97.76% 97.74% -0.02%
==========================================
Files 1415 1415
Lines 86264 86275 +11
Branches 4348 4349 +1
==========================================
- Hits 84332 84328 -4
- Misses 1932 1947 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Datadog ReportBranch report: ✅ 0 Failed, 21254 Passed, 1373 Skipped, 3m 37.28s Total Time |
vpellan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment but except the steep error, LGTM !
BenchmarksBenchmark execution time: 2025-05-01 21:10:27 Comparing candidate commit e39bd7a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but this PR as far as I can tell does not change the modulo and hence makes no changes to sampling algorithm, it only rejects 1<<64 as a trace id (externally supplied?).
Yes @p-datadog, there is no change in the modulo or the formula itself other than the cosmetic one of separating the modulo and MAX_EXTERNAL_ID. The old value of MAX_EXTERNAL_ID was an uint65 instead of uint64 (hence the -1) |
|
@genesor could you update the changelog entry in the PR description with this please? |
|
Does the |
@p-datadog I'd say no, this is not an ID we can produce in other languages as it is bound to the limit of |
* telemetry-integration-test: (21 commits) fix test cleanup fix test setup try a non-zero timeout? fix integration test Update spec/datadog/core/telemetry/integration/telemetry_spec.rb fix other test fix flushing flush telemetry events fix test provide a block rubocop rubocop di add content-type assertion wait for thread to end telemetry integration test do not initialize components from on fork handler Emtpy string Bump the gh-actions-packages group across 2 directories with 4 updates [APMAPI-1258] Adjust trace sampling formula (DataDog#4616) Add baggage to karafka list of propagation styles (DataDog#4614) ...
What does this PR do?
Adjust the knuth sampling formula to have the same one across every tracer.
Motivation:
There is slight differences between every tracer in the implementation of this formula. The Ruby one was correct but the modulo was based on the
EXTERNAL_MAX_IDvalue that was wrong (off by one)Change log entry
Yes. Cosmetic change on the knuth sampling formula to have a clear separation between uint64 modulo in a new const
UINT64_MODULO(1<<64) andMAX_EXTERNAL_ID((1<<64) -1)Additional Notes:
How to test the change?