Skip to content

Add OTLP/HTTP support to MockTracerAgent and migrate OTLP AspNetCore tests off Docker - #9097

Draft
chojomok wants to merge 8 commits into
otel-aspnetcorefrom
otlp-http-mocktracer
Draft

Add OTLP/HTTP support to MockTracerAgent and migrate OTLP AspNetCore tests off Docker#9097
chojomok wants to merge 8 commits into
otel-aspnetcorefrom
otlp-http-mocktracer

Conversation

@chojomok

@chojomok chojomok commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

  • Adds OTLP/HTTP (JSON + protobuf) trace decoding to MockTracerAgent: /v1/traces decodes into a typed MockOtlpSpan/MockOtlpTraceRequest DTO tree via the official ExportTraceServiceRequest protobuf type; /v1/metrics//v1/logs are captured raw (no decode), so they never reach the MessagePack decoder.
  • Moves the generated OTLP protobuf types from Datadog.Trace.Tests into Datadog.Trace.TestHelpers so MockTracerAgent can use them.
  • Adds WaitForOtlpSpansAsync, OtlpSpanFilters, and protocol-correct responses ({} for JSON, zero-byte body for protobuf), following the existing WaitForSpansAsync/SpanFilters/TraceRequestHeaders conventions.
  • Migrates the OtlpAspNetCoreMvc21Tests/OtlpAspNetCoreMvc31Tests/OtlpAspNetCoreMinimalApisTests suites off the Docker ddapm-test-agent onto this new in-process infrastructure.

Reason for change

HTTP OTLP integration tests currently send payloads to the Docker ddapm-test-agent and normalize/snapshot raw JSON. The in-process MockTracerAgent already receives Datadog traces, stores test-friendly DTOs, and provides async wait helpers. Supporting OTLP/HTTP in the same mock agent gives tests typed spans instead of transport-specific snapshots, and removes a Docker dependency from the OTLP AspNetCore HTTP suites.

Implementation details

Design doc: docs/superpowers/specs/2026-08-21-otlp-http-mocktracer-design.md

  • HandlePotentialOtlpTraces decodes Content-Type: application/x-protobuf via ExportTraceServiceRequest.Parser.ParseFrom, and application/json via a hex-to-base64 ID pre-pass (the tracer's OTLP/JSON exporter encodes IDs as hex, but the standard OTLP JSON mapping expects base64) followed by Google.Protobuf's JsonParser.
  • OtlpAspNetCoreTestBase now points the sample app's OTLP export at the fixture's existing MockTracerAgent instance (via a new onAgentCreated hook on AspNetCoreTestFixture.TryStartApp, since the agent's port isn't known until the agent is created) instead of the Docker ddapm-test-agent. Test-case isolation mirrors the existing non-OTLP flow: WaitForOtlpSpansAsync filters by a minDateTime captured before each request, and a new OtlpSpanFilters list (mirroring SpanFilters) excludes the warm-up /alive-check span the same way the Datadog-protocol path already does.
  • The snapshot pipeline reuses OtlpSnapshotHelper unchanged, bridging each captured MockOtlpTraceRequest back to the OTLP JSON wire shape via Google.Protobuf's JsonFormatter (always camelCase/base64, regardless of which wire protocol the request arrived over) and OtlpFieldNames.For(isJson: true).
  • OpenTelemetrySdkTests/OpenTelemetryWebRequestTests/OpenTelemetryHttpClientTests are untouched and remain on the Docker test agent (gRPC/metrics/logs coverage, and traces-only suites left as optional follow-up).

Test coverage

  • New unit tests in Datadog.Trace.Tests/Agent/MockOtlpTraceDecodingTests.cs: protobuf decode, JSON decode with hex→base64 ID normalization, gzip, response shapes, unsupported content-type, metrics/logs isolation, Datadog+OTLP coexistence, WaitForOtlpSpansAsync.
  • OtlpAspNetCoreMvc31Tests (54 cases, all feature-flag/OTel-semantics variants) — all pass against the existing, unmodified Verify snapshots.
  • OtlpAspNetCoreMinimalApisTests (54 cases) — all pass against existing snapshots.
  • OtlpAspNetCoreMvc21Tests — not run locally (sample targets netcoreapp2.1, not installed on this dev machine); should be verified in CI.

Other details

This PR was developed with heavy AI assistance (Claude Code): the design was brainstormed and written up as a spec, the implementation (decoding pipeline, test migration, and code-review fixes) was written and iterated by the AI agent, with human review and direction throughout. Please review accordingly.

chojomok and others added 6 commits August 21, 2026 13:23
Documents the plan to add OTLP/HTTP (JSON + protobuf) trace decoding to
MockTracerAgent per the RFC, and to migrate the OtlpAspNetCore* test
suites off the Docker ddapm-test-agent onto it as end-to-end validation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
MockTracerAgent (in TestHelpers) needs the generated OTLP trace proto
types to decode OTLP/HTTP payloads, but TestHelpers can't depend on
Datadog.Trace.Tests where they previously lived. Relocate the generated
bindings and their vendored .proto sources so both projects can use
them; Datadog.Trace.Tests already project-references TestHelpers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Routes /v1/traces to a new decoder that parses both OTLP/HTTP JSON and
protobuf into the official ExportTraceServiceRequest type via
Google.Protobuf, then maps it into a typed MockOtlp* DTO tree
(MockOtlpTraceRequest -> MockOtlpResourceSpans -> MockOtlpScopeSpans ->
MockOtlpSpan) plus a flattened OtlpSpans view, mirroring the existing
Spans/TraceRequestHeaders/WaitForSpansAsync conventions. /v1/metrics
and /v1/logs are captured raw (no decode) so they never reach the
MessagePack decoder. Responses are protocol-correct: {} for JSON,
zero-byte body for protobuf.

The tracer's OTLP/JSON exporter encodes trace/span/parent IDs as hex
(not the standard base64 protobuf-JSON mapping), so JSON requests get
a pre-pass converting those fields to base64 before Google.Protobuf's
JsonParser runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Covers protobuf decode, JSON decode with hex-to-base64 ID
normalization, gzip-compressed bodies, protocol-correct response
shapes, unsupported content-type errors, /v1/metrics and /v1/logs raw
capture (isolation from trace decoding), coexistence of Datadog and
OTLP requests on the same agent, and WaitForOtlpSpansAsync.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Points the OTLP AspNetCore suites at the fixture's existing in-process
MockTracerAgent instead of the Docker ddapm-test-agent, using the new
OTLP/HTTP decoding support: ConfigureOtlpExport now takes the mock
agent's own /v1/traces URL, set once the agent (and its port) exists
via a new onAgentCreated hook on AspNetCoreTestFixture.TryStartApp.

Test-case isolation mirrors the existing non-OTLP flow exactly:
MockTracerAgent.WaitForOtlpSpansAsync filters by a minDateTime captured
before each request, rather than clearing any shared session state.
Added OtlpSpanFilters (mirroring SpanFilters) so the warm-up
alive-check request's span can be excluded the same way the Datadog
protocol path already excludes it.

The snapshot pipeline reuses OtlpSnapshotHelper unchanged, bridging
each captured MockOtlpTraceRequest back to the OTLP JSON wire shape via
Google.Protobuf's JsonFormatter (always camelCase/base64, regardless of
which wire protocol the request arrived over) and OtlpFieldNames.For
(isJson: true). All existing snapshots pass unmodified.

OpenTelemetrySdkTests/OpenTelemetryWebRequestTests/OpenTelemetryHttpClientTests
are untouched and remain on the Docker test agent (gRPC/metrics/logs
coverage, and traces-only suites left as optional follow-up).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
global:: isn't used elsewhere in the codebase outside a handful of
unrelated System.* attribute usages; alias the OTLP proto types
instead, matching the existing OtlpSpan/OtlpStatusCode convention from
OtlpTracesProtobufSerializerTests.cs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (9097) and master.

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@pr-commenter

pr-commenter Bot commented Aug 21, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-21 22:07:18

Comparing candidate commit 7eb68bf in PR branch otlp-http-mocktracer with baseline commit e476ea7 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 68 known flaky benchmarks, 58 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-28766.474op/s; -25944.132op/s] or [-8.102%; -7.307%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472

  • 🟩 throughput [+10805.679op/s; +11594.944op/s] or [+6.984%; +7.494%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472

  • 🟥 throughput [-13518.145op/s; -11004.240op/s] or [-7.730%; -6.293%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472

  • 🟥 throughput [-11118.028op/s; -10115.307op/s] or [-7.255%; -6.600%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-9342.063op/s; -8683.693op/s] or [-11.077%; -10.296%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-9237.539op/s; -7842.503op/s] or [-9.393%; -7.974%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+1.605KB; +1.605KB] or [+48.760%; +48.776%]
  • 🟥 execution_time [+307.730ms; +311.074ms] or [+152.707%; +154.366%]
  • 🟥 throughput [-56.986op/s; -52.391op/s] or [-10.253%; -9.426%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 allocated_mem [+1.012KB; +1.012KB] or [+37.524%; +37.537%]
  • 🟥 execution_time [+374.461ms; +375.336ms] or [+295.847%; +296.538%]
  • 🟩 throughput [+70.340op/s; +71.876op/s] or [+9.274%; +9.477%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 allocated_mem [+1.090KB; +1.090KB] or [+40.417%; +40.429%]
  • 🟥 execution_time [+391.709ms; +395.941ms] or [+346.647%; +350.393%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+4.692KB; +4.693KB] or [+98.785%; +98.801%]
  • 🟥 throughput [-61750.593op/s; -61141.346op/s] or [-48.045%; -47.571%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-16.143ms; -11.959ms] or [-7.539%; -5.585%]
  • 🟥 throughput [-59750.005op/s; -56968.822op/s] or [-43.614%; -41.584%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-48964.330op/s; -46703.273op/s] or [-44.269%; -42.225%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.315KB; +1.315KB] or [+106.388%; +106.404%]
  • 🟥 throughput [-275781.250op/s; -265540.438op/s] or [-28.159%; -27.113%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-25.673ms; -20.800ms] or [-11.449%; -9.276%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-177064.193op/s; -158816.595op/s] or [-25.441%; -22.819%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-73013.757op/s; -72243.311op/s] or [-49.137%; -48.619%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-73114.548op/s; -70227.566op/s] or [-46.522%; -44.685%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56355.986op/s; -53735.938op/s] or [-44.895%; -42.808%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+315541.621op/s; +333127.310op/s] or [+10.522%; +11.108%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-18.947ms; -14.613ms] or [-8.734%; -6.736%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟩 allocated_mem [-13.759KB; -13.756KB] or [-42.324%; -42.316%]
  • 🟥 execution_time [+300.265ms; +301.042ms] or [+150.032%; +150.420%]
  • 🟩 throughput [+915.989op/s; +938.444op/s] or [+10.117%; +10.365%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+299.227ms; +307.291ms] or [+150.901%; +154.968%]
  • 🟩 throughput [+2307.746op/s; +2594.033op/s] or [+17.651%; +19.840%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+299.907ms; +308.611ms] or [+151.070%; +155.454%]
  • 🟩 throughput [+1709.259op/s; +1918.251op/s] or [+16.502%; +18.520%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+295.253ms; +296.353ms] or [+145.016%; +145.557%]
  • 🟩 throughput [+539.189op/s; +554.110op/s] or [+14.294%; +14.690%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+298.509ms; +301.161ms] or [+145.930%; +147.227%]
  • 🟩 throughput [+2682.014op/s; +2761.185op/s] or [+38.965%; +40.115%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+301.121ms; +301.582ms] or [+150.500%; +150.730%]
  • 🟩 throughput [+1402.068op/s; +1425.824op/s] or [+27.830%; +28.301%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • 🟩 execution_time [-147.491µs; -143.597µs] or [-30.282%; -29.482%]
  • 🟩 throughput [+862.833op/s; +888.132op/s] or [+42.024%; +43.256%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0

  • 🟩 execution_time [-140.798µs; -114.212µs] or [-32.292%; -26.195%]
  • 🟩 throughput [+881.278op/s; +1001.891op/s] or [+38.314%; +43.558%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • 🟩 execution_time [-139.921µs; -116.887µs] or [-29.979%; -25.043%]
  • 🟩 throughput [+744.567op/s; +841.546op/s] or [+34.371%; +38.847%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • 🟩 execution_time [-127.902µs; -123.614µs] or [-34.533%; -33.375%]
  • 🟩 throughput [+1364.324op/s; +1414.430op/s] or [+50.528%; +52.384%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟩 execution_time [-102.760µs; -79.063µs] or [-32.806%; -25.241%]
  • 🟩 throughput [+1189.462op/s; +1395.394op/s] or [+37.079%; +43.499%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • 🟩 execution_time [-136.947µs; -114.485µs] or [-37.463%; -31.319%]
  • 🟩 throughput [+1314.461op/s; +1454.561op/s] or [+47.171%; +52.198%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.682ms; +300.524ms] or [+149.572%; +149.992%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+417.142ms; +422.920ms] or [+453.242%; +459.520%]
  • 🟩 throughput [+783.722op/s; +959.310op/s] or [+6.440%; +7.883%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • 🟥 execution_time [+364.024ms; +368.497ms] or [+276.400%; +279.796%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+289.418ms; +328.753ms] or [+133.071%; +151.158%]
  • 🟥 throughput [-654.318op/s; -606.087op/s] or [-59.288%; -54.917%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+208.716ms; +342.021ms] or [+88.946%; +145.755%]
  • 🟥 throughput [-687.949op/s; -603.858op/s] or [-45.886%; -40.278%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+340.144ms; +349.792ms] or [+203.446%; +209.216%]
  • 🟥 throughput [-397.835op/s; -361.058op/s] or [-27.701%; -25.140%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-174.568µs; -107.485µs] or [-8.843%; -5.445%]
  • 🟩 throughput [+32.179op/s; +49.869op/s] or [+6.352%; +9.844%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.956ms; +303.893ms] or [+152.059%; +153.035%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+300.809ms; +302.780ms] or [+150.736%; +151.724%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+301.460ms; +304.699ms] or [+151.441%; +153.068%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.998ms; +304.675ms] or [+152.155%; +152.998%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+296.061ms; +301.728ms] or [+146.389%; +149.191%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+302.115ms; +306.379ms] or [+153.125%; +155.286%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.338ms; +301.450ms] or [+150.241%; +151.301%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+295.744ms; +307.816ms] or [+147.401%; +153.418%]
  • 🟩 throughput [+27589.046op/s; +42249.568op/s] or [+5.478%; +8.389%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+300.135ms; +303.989ms] or [+149.315%; +151.232%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.299ms; -12.646ms] or [-7.579%; -5.880%]
  • 🟩 throughput [+18895.802op/s; +26226.084op/s] or [+5.184%; +7.195%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+10.418µs; +53.557µs] or [+2.573%; +13.229%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-19.095KB; -19.071KB] or [-6.966%; -6.957%]
  • unstable execution_time [+0.019µs; +58.300µs] or [+0.004%; +11.523%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • unstable execution_time [-80.816µs; -18.105µs] or [-14.005%; -3.137%]
  • unstable throughput [+80.158op/s; +260.490op/s] or [+4.580%; +14.882%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • unstable execution_time [+9.677µs; +14.477µs] or [+22.875%; +34.220%]
  • 🟥 throughput [-6124.703op/s; -4219.524op/s] or [-25.783%; -17.763%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-12.491µs; -4.539µs] or [-19.380%; -7.042%]
  • unstable throughput [+1015.769op/s; +2771.021op/s] or [+6.232%; +17.001%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.346ms; +304.538ms] or [+153.328%; +153.931%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+302.485ms; +305.336ms] or [+153.964%; +155.415%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+298.503ms; +300.560ms] or [+149.438%; +150.467%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472

  • 🟥 throughput [-21184.261op/s; -19591.910op/s] or [-5.864%; -5.424%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+35125.808op/s; +38738.845op/s] or [+6.649%; +7.332%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.974ms; +300.753ms] or [+149.011%; +149.898%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.001ms; +303.132ms] or [+151.148%; +152.218%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+303.907ms; +308.122ms] or [+154.122%; +156.260%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.627ms; +301.481ms] or [+149.955%; +150.380%]
  • 🟩 throughput [+65983056.876op/s; +66331845.983op/s] or [+48.053%; +48.307%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+416.816ms; +420.779ms] or [+518.385%; +523.313%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.640ms; +300.950ms] or [+149.454%; +150.107%]
  • 🟩 throughput [+17945634.431op/s; +18943441.578op/s] or [+7.949%; +8.391%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+101661.089op/s; +110812.153op/s] or [+9.492%; +10.346%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+72081.246op/s; +104369.376op/s] or [+5.579%; +8.078%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+71814.461op/s; +81682.621op/s] or [+7.132%; +8.112%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+43616.301op/s; +49167.988op/s] or [+7.920%; +8.928%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

- MockHeaders.GetValue: use TryGetValue instead of GetValues, which
  throws InvalidOperationException when a header is absent -- a
  request to /v1/traces with no Content-Type would crash instead of
  getting the intended 400 response.
- Add MockOtlpAttributeValueKind.Empty and handle both a null
  KeyValue.Value and AnyValue.ValueOneofCase.None, instead of throwing
  NRE/NotSupportedException for legal-but-empty OTLP attribute values.
- MockOtlpJsonIdNormalizer: throw a clear FormatException for a
  malformed hex ID instead of silently leaving it unconverted, which
  previously surfaced as a confusing "invalid base64" error from
  Google.Protobuf's JsonParser further downstream.
- Use names.SpanId instead of a hardcoded "spanId" literal in the
  AspNetCore snapshot-bridge span filter, matching every other lookup
  in the same method.
- Normalize is null/is not null usage in the new OTLP code paths.
- Extract the WaitForSpansAsync/WaitForOtlpSpansAsync polling loop
  (deadline, 16ms clock-skew tolerance, operationName filtering) into
  a shared private WaitForSpansCoreAsync<TSpan>, removing the
  near-duplicate implementation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chojomok chojomok added AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:opentelemetry OpenTelemetry support area:tests unit tests, integration tests type:new-feature labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:opentelemetry OpenTelemetry support area:tests unit tests, integration tests type:new-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant