test(otlp): Refactor OTLP end-to-end testing helpers - #8973
test(otlp): Refactor OTLP end-to-end testing helpers#8973zacharycmontoya wants to merge 3 commits into
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8973) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (72ms) : 68, 77
master - mean (71ms) : 69, 73
section Bailout
This PR (8973) - mean (75ms) : 73, 77
master - mean (78ms) : 74, 83
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,096ms) : 1052, 1140
master - mean (1,103ms) : 1038, 1168
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (111ms) : 106, 116
master - mean (113ms) : 106, 119
section Bailout
This PR (8973) - mean (112ms) : 110, 114
master - mean (115ms) : 110, 120
section CallTarget+Inlining+NGEN
This PR (8973) - mean (793ms) : 768, 819
master - mean (787ms) : 754, 819
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (99ms) : 96, 101
master - mean (101ms) : 95, 107
section Bailout
This PR (8973) - mean (103ms) : 95, 110
master - mean (98ms) : 97, 100
section CallTarget+Inlining+NGEN
This PR (8973) - mean (959ms) : 912, 1007
master - mean (947ms) : 906, 988
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (98ms) : 93, 103
master - mean (96ms) : 94, 99
section Bailout
This PR (8973) - mean (99ms) : 96, 102
master - mean (102ms) : 98, 107
section CallTarget+Inlining+NGEN
This PR (8973) - mean (829ms) : 786, 872
master - mean (822ms) : 780, 865
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (209ms) : 205, 213
master - mean (209ms) : 204, 214
section Bailout
This PR (8973) - mean (214ms) : 210, 217
master - mean (213ms) : 210, 217
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,255ms) : 1214, 1296
master - mean (1,252ms) : 1191, 1314
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (299ms) : 293, 304
master - mean (299ms) : 294, 304
section Bailout
This PR (8973) - mean (301ms) : 296, 305
master - mean (300ms) : 294, 305
section CallTarget+Inlining+NGEN
This PR (8973) - mean (997ms) : 979, 1014
master - mean (998ms) : 978, 1018
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (293ms) : 286, 300
master - mean (292ms) : 288, 297
section Bailout
This PR (8973) - mean (294ms) : 288, 300
master - mean (294ms) : 290, 297
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,192ms) : 1148, 1235
master - mean (1,187ms) : 1153, 1221
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8973) - mean (293ms) : 288, 297
master - mean (292ms) : 288, 296
section Bailout
This PR (8973) - mean (292ms) : 288, 297
master - mean (292ms) : 287, 297
section CallTarget+Inlining+NGEN
This PR (8973) - mean (1,068ms) : 1024, 1112
master - mean (1,070ms) : 1004, 1137
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
andrewlock
left a comment
There was a problem hiding this comment.
Started reviewing the helper before I twigged that it was a direct copy (the description does say that, it's on me 🤦♂️) so otherwise just assumed it's ok.
Strange so many tests are failing though? 🤔
| // by the test agent with snake_case field names and string-form enum values) to the | ||
| // OTLP http/json shape (camelCase field names, integer enum values). When a new OTLP | ||
| // field or enum reaches the serializer, add the mapping here. | ||
| private static readonly (string From, string To)[] ProtobufToJsonFieldNameMappings = |
There was a problem hiding this comment.
Isn't this same mapping encoded in OtlpFieldNames? Do we need both?
| ("\"code\": \"STATUS_CODE_ERROR\"", "\"code\": 2"), | ||
| }; | ||
|
|
||
| private static readonly Regex TraceIdRegex = new(@"^([a-fA-F0-9]{32})$"); |
There was a problem hiding this comment.
Do we need to handle 64bit TraceIDs, or no, because this is Otel only?
7552a06 to
21e7265
Compare
BenchmarksBenchmark execution time: 2026-08-03 19:22:01 Comparing candidate commit 21e7265 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 67 known flaky benchmarks, 59 flaky benchmarks without significant changes.
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
21e7265 to
419d612
Compare
Summary of changes
Test-only changes to consolidate the submission/retrieval/scrubbing of OTLP data in the end-to-end snapshot test cases in
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cs.Reason for change
Isolating OTLP handling will allow us to more easily author OTLP end-to-end snapshot test cases in other sample applications.
Implementation details
Ports helpers methods from
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/OpenTelemetrySdkTests.cstotracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/OtlpSnapshotHelper.csThis also updates the
Datadog.Trace.OSXsolution filter to exclude a test application with the legacy style csproj file to reduce build errors in Rider on macOS.Test coverage
The existing
OpenTelemetrySdkTestsconfirm that the tests pass as before.Other details
Note: This is built on top of the existing OpenTelemetry branches because it was isolated into its own set of commits while working on the comprehensive set of changes.