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.
🚫 [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.
🚫 [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.
🚫 [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.
🚫 [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.
🚫 [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.
🚫 [golangci] reported by reviewdog 🐶
undefined: context) (typecheck)
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!