[APMAPI-1258] Adjust trace sampling formula #4616
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4616 +/- ##
==========================================
- Coverage 97.76% 97.74% -0.03%
==========================================
Files 1415 1415
Lines 86264 86275 +11
Branches 4348 4349 +1
==========================================
- Hits 84339 84328 -11
- Misses 1925 1947 +22 ☔ 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.
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. |
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 |
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?