Repository navigation
feat(otel): otel sampling support in distributed tracing #10117
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
Merged
Merged
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
49eb625
First implementation for OTel sampling support
vpellan 5785a9b
CODEOWNERS
vpellan 9a7dfdd
fix(otel): generate sampling state for OTel propagation
vpellan af0fa51
fix(sampling): preserve committed decision metadata during checks
vpellan 1186c76
fix(standalone): mark extracted force-keeps non-probability
vpellan 30ab81c
fix(propagation): merge matching W3C tracestate into B3 context
vpellan 42005a6
perf(sampling): defer OTel decision metadata until propagation
vpellan 660cb44
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 46548fb
fix(otel): preserve standard parent tracestate
vpellan e8d4fd6
fix(sampling): refresh manual decision maker
vpellan 9c18613
fix(propagation): clear conflicting OTel thresholds
vpellan f9ff0ad
refactor(sampling): use kebab-case filenames
vpellan 8fa5940
fix(otel): ignore uncommitted sampling probe rates
vpellan 9dc3f5d
fix(otel): preserve inherited tracestate member order
vpellan cf02963
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 6c0513a
fix(propagation): inherit W3C priority when selected style omits it
vpellan 3e895ea
fix(sampling): ignore invalid priority tag values
vpellan 59c8dd7
fix(sampling): avoid rescanning stale legacy tags
vpellan c0614ce
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 3447697
fix(sampling): preserve product force-keep decisions
vpellan abf2703
fix(propagation): clear threshold for B3 debug decisions
vpellan fa1dad8
perf(sampling): restore decision hot path
vpellan d7deb7d
refactor(sampling): expose automatic decision hook
vpellan d5c0f55
perf(sampling): prefer value checks for manual tags
vpellan 1f726e5
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 57d5657
fix(propagation): clear stale decision maker on conflicts
vpellan 5af8a45
fix(sampling): preserve product mechanism during probes
vpellan df787d4
fix(propagation): unify matching tracecontext state
vpellan c13b5f1
fix(standalone): preserve mechanism during probes
vpellan 0af916c
fix(sampling): ignore inherited bulk sampling tags
vpellan 6e6f7f0
test(propagation): preserve agreeing rule sampling state
vpellan a8937f5
test(sampling): codify allowed rate-limit semantics
vpellan 3237de8
fix(propagation): clear stale state for B3 debug
vpellan ddf0605
fix(propagation): inherit W3C decision metadata
vpellan 875ae2e
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan eef8dcd
perf(tracing): optimize bulk sampling tag checks
vpellan dd8c192
fix(propagation): merge implicit W3C state into winner
vpellan 77ef7a5
fix(otel): preserve inherited sampling mechanism
vpellan e74e7cc
fix(otel): preserve inherited decision maker tag
vpellan b99215d
fix(propagation): inherit agreeing W3C decision metadata
vpellan 8444a9a
fix(otel): map inherited Datadog tracestate fields
vpellan fade28a
fix(propagation): hydrate Datadog sampling mechanism
vpellan ca108b1
fix(propagation): preserve state after oversized member
vpellan 754e47f
refactor(otel): keep unrelated tracestate fields opaque
vpellan 2ea52be
refactor(otel): keep decision maker in tracestate
vpellan 79fa291
refactor(propagation): keep agreeing metadata opaque
vpellan 4dcb1fb
fix(propagation): drop aggregate tracestate byte limit
vpellan c59b5f5
perf(propagation): truncate tracestate without splitting
vpellan f208aa4
perf(propagation): skip limiting compliant tracestate
vpellan b206827
fix(sampling): preserve manual tag precedence
vpellan 5abbee7
fix(otel): omit zero probability sampling state
vpellan d00d5ba
perf(propagation): clone tracestate without reparsing
vpellan d021372
perf(propagation): avoid no-op vendor rewrites
vpellan 1b8704a
refactor(otel): mutate parsed tracestate fields
vpellan ccdc1db
perf(otel): validate sampling fields inline
vpellan 1825044
fix(otel): sanitize sampling state on extraction
vpellan 1687e9a
perf(otel): clone span context tracestate directly
vpellan ed2d80e
test(sampling): wrap manual tag assertion
vpellan 46fe5f8
fix(otel): bound vendor fields before parsing
vpellan 206dc05
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 103e489
refactor(sampling): remove unused single-tag entry point
vpellan 03621d0
fix(sampling): preserve precedence across bulk tag updates
vpellan 28b70d7
refactor(sampling): use value checks for bulk sampling tags
vpellan 40543a6
fix(otel): normalize sampling state from standard parents
vpellan 525dc3b
perf(propagation): fast-path single-digit decision makers
vpellan b3bb057
Add test for >32 otel members
vpellan 5ae63fe
fix(propagation): enforce tracestate limits and bound pruning work (#…
BridgeAR ef1ddb9
fix(standalone): mark inherited product keeps non-probabilistic
vpellan b427c4e
Merge branch 'master' into vpellan/otel-threshold-random-value
vpellan 3389e38
Fix failing llmobs tests
vpellan 5911351
Apply batched suggestions from code review
vpellan 2194615
fix(propagation): preserve decision-maker parsing semantics
vpellan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| 'use strict' | ||
|
|
||
| const UINT64_MODULO = 2n ** 64n | ||
|
|
||
| // Knuth's factor for the sampling algorithm shared across Datadog tracers. | ||
| const SAMPLING_KNUTH_FACTOR = 1_111_111_111_111_111_111n | ||
|
|
||
| /** | ||
| * Hashes the lower 64 bits of a trace ID for deterministic trace sampling. | ||
| * | ||
| * @param {bigint} traceId | ||
| */ | ||
| function knuthHash (traceId) { | ||
| return (traceId * SAMPLING_KNUTH_FACTOR) % UINT64_MODULO | ||
| } | ||
|
|
||
| module.exports = knuthHash | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.