Refactor transport strategies code#3126
Merged
Merged
Conversation
We currently reuse this code for traces and telemetry We will soon have other implementations to add
This comment has been minimized.
This comment has been minimized.
andrewlock
force-pushed
the
andrew/refactor-transport-strategies
branch
from
August 25, 2022 16:26
a8f772c to
0958492
Compare
Member
Author
Benchmarks Report 🐌Benchmarks for #3126 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 - Unknown 🤷 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
|
Member
Author
Code Coverage Report 📊✔️ Merging #3126 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 #3126:
1 classes were removed from Datadog.Trace in #3126 View the full reports for further details: |
dromanol
approved these changes
Aug 29, 2022
dromanol
left a comment
Contributor
There was a problem hiding this comment.
LGTM. It's always good to extract common code.
| tcpTimeout: Timeout, | ||
| TelemetryHttpHeaderNames.GetDefaultAgentHeaders(), | ||
| () => new TelemetryAgentHttpHeaderHelper(), | ||
| uri => UriHelpers.Combine(uri, TelemetryConstants.AgentTelemetryEndpoint)); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of changes
TracesTransportStrategyandTelemetryTransportStrategyReason for change
The code for choosing the correct
IApiRequestFactorybased onExporterSettingsand target framework is…convoluted. Currently we duplicate most of this inTracesTransportStrategyandTelemetryTransportStrategy. However, for data streams monitoring I need to create a new one which will be another copy, and @shurivich also needs a new one to support UDS etc..Implementation details
Extract the common bits, pass the rest in as parameters, or
Func<T>where appropriate. I also removed the static helpers onDatadogHttpClientas didn't feel right to keep creating extra methods there (and they're now unused anyway).Test coverage
Should be covered by all existing tests
Other details
I think this is a prerequisite for necessary changes to #3125.