Implement the SpanSampler into the Tracer#3286
Conversation
0283733 to
14ce1ec
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
pierotibou
left a comment
There was a problem hiding this comment.
Nice work!
With a few comments, mainly on tests.
andrewlock
left a comment
There was a problem hiding this comment.
LGTM (though sampling's not really my thing!) Just minor comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
83daacc to
2bcd43e
Compare
…/dd-trace-dotnet into steven/single-span/limiter
This comment has been minimized.
This comment has been minimized.
2bcd43e to
13a2096
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I tried running the benchmarks on master and they're the same as your PR, so I guess the difference comes from a commit you haven't merged into your branch. |
This comment has been minimized.
This comment has been minimized.
The tags wouldn't get set throgh Span.SetTag as the Span would be marked as finished before it was actually closed. When it gets closed is when the span sampler runs.
Benchmarks Report 🐌Benchmarks for #3286 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
Code Coverage Report 📊✔️ Merging #3286 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
The following classes were added in #3286:
View the full reports for further details: |
Summary of changes
This pull request adds the
SpanSamplerinto the Tracer to support the Single Span Ingestion feature.Reason for change
To allow for individual Spans that were going to be dropped to be sampled independently of their host Trace.
Implementation details
This adds the
ISpanSamplerinterface andSpanSamplerimplementation that will sample aSpanwithinTraceContext.CloseSpanwhen its containing trace is being dropped due to having a priority<=0.Test coverage
SpanSampler->SpanSamplerTestsTraceContext.CloseSpanin a new classSpanTagTeststo check whether the spans get tagged correctlyOther details
Previous PRs:
SpanRateLimiterfor Single Span Ingestion #3282SpanSamplingRulefor Single Span Ingestion #3283