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
ddtrace/tracer: adding sampling by resource and tags #2448
Conversation
…ying sampling rules (#2407)
BenchmarksBenchmark execution time: 2024-01-08 14:59:07 Comparing candidate commit 5305d5f in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 38 metrics, 2 unstable metrics. scenario:BenchmarkTracerAddSpans-24
|
_, _, _, stop := startTestTracer(t) | ||
defer stop() | ||
|
||
s, _ := StartSpanFromContext(context.Background(), "web.request", |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context
tr, _, _, stop := startTestTracer(t) | ||
defer stop() | ||
|
||
originSpan, _ := StartSpanFromContext(context.Background(), "web.request", |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context
w3cCtx, err := tr.Extract(headers) | ||
assert.Nil(t, err) | ||
|
||
w3cSpan, _ := StartSpanFromContext(context.Background(), "web.request", ChildOf(w3cCtx)) |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context (typecheck)
_, _, _, stop := startTestTracer(t) | ||
defer stop() | ||
|
||
s, _ := StartSpanFromContext(context.Background(), "web.request", |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context
tr, _, _, stop := startTestTracer(t) | ||
defer stop() | ||
|
||
originSpan, _ := StartSpanFromContext(context.Background(), "web.request", |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context
w3cCtx, err := tr.Extract(headers) | ||
assert.Nil(t, err) | ||
|
||
w3cSpan, _ := StartSpanFromContext(context.Background(), "web.request", ChildOf(w3cCtx)) |
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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context) (typecheck)
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.
LGTM
What does this PR do?
This PR changes the sampling rule matching logic. Tests are updated accordingly.
Additionally, updated the MarshalJSON method of the SamplingRule.
What to remember when reviewing
Motivation
Reviewer's Checklist
For Datadog employees:
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!