Test RemoteConfigurationApi instead of using file provider#3182
Conversation
6bd31fd to
a189ea6
Compare
This comment has been minimized.
This comment has been minimized.
| string.IsNullOrWhiteSpace(remoteConfigurationSettings.FilePath) | ||
| ? RemoteConfigurationApi.Create(apiRequestFactory, discoveryService) | ||
| : RemoteConfigurationFileApi.Create(remoteConfigurationSettings); | ||
| return RemoteConfigurationApi.Create(apiRequestFactory, discoveryService); |
There was a problem hiding this comment.
I think you can remove entire class, and use direct call RemoteConfigurationApi.Create(apiRequestFactory, discoveryService), instead?
There was a problem hiding this comment.
Could do yeah. I kind of like that it incapsulates this for now, as otherwise it's just more lines in the (already large) Instrumentation class. It could well make sense to remove it when you refactor the RCM creation into TracerManager though 🙂
|
|
||
| namespace Datadog.Trace.RemoteConfigurationManagement.Transport | ||
| { | ||
| internal class RemoteConfigurationFileApi : IRemoteConfigurationApi |
There was a problem hiding this comment.
I'm so happy this will be deleted! 😄
shurivich
left a comment
There was a problem hiding this comment.
LGTM
I'm happy with this change
This comment has been minimized.
This comment has been minimized.
a189ea6 to
cc10fd1
Compare
Benchmarks Report 🐌Benchmarks for #3182 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
|
Code Coverage Report 📊✔️ Merging #3182 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
1 classes were removed from Datadog.Trace in #3182 View the full reports for further details: |
Summary of changes
Removes the
RemoteConfigurationFileApiin favour of using the actual implementationReason for change
Currently we're not testing the
IRemoteConfigurationApithat we're using in production, as we're using a completely separate implementation.This File API was introduced to make debugging easier without an agent, but IMO this is the wrong approach, as it ultimately requires we have completely separate implementations. Given we now require the agent be present before RCM even runs (due to the
/infodependency), I don't think this approach is worth pursuing further.An (IMO) better approach is to make it easy to run a MockTracerAgent instance and allow configuring (this) by file for better debugging. This could then support/test multiple products, instead of the single-use approach we have currently.
Implementation details
Removed the
RemoteConfigurationFileApiand associated paraphernalia. Added ability to set the RCM response to use on the MockAgentTest coverage
Should have more coverage as now we're actually testing the implementation
Other details
Feel free to tell me you hate it @OmerRaviv @shurivich 😄