Skip to content

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

Draft
chojomok wants to merge 23 commits into
masterfrom
otlp-http-mocktracer
Draft

Add OTLP/HTTP support to MockTracerAgent and migrate OTLP AspNetCore tests off Docker#9097
chojomok wants to merge 23 commits into
masterfrom
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.

@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-09-11 21:25:47

Comparing candidate commit 007df8e in PR branch otlp-http-mocktracer with baseline commit 12e9e34 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 43 performance regressions! Performance is the same for 28 metrics, 1 unstable metrics, 108 known flaky benchmarks, 18 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.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-28890.864op/s; -27305.993op/s] or [-15.283%; -14.444%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-40369.207op/s; -36306.438op/s] or [-14.190%; -12.762%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-32819.767op/s; -29805.467op/s] or [-15.341%; -13.932%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-22980.210op/s; -21824.452op/s] or [-12.601%; -11.967%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-33047.303op/s; -29516.524op/s] or [-11.968%; -10.689%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-33078.012op/s; -31245.907op/s] or [-15.473%; -14.616%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-22384.343op/s; -21448.515op/s] or [-12.278%; -11.765%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-40648.313op/s; -36599.013op/s] or [-14.443%; -13.004%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-28120.611op/s; -25790.350op/s] or [-13.491%; -12.373%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_GetCurrentSpan net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-32027.938op/s; -31209.399op/s] or [-17.247%; -16.806%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_GetCurrentSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-21922.614op/s; -18847.812op/s] or [-8.171%; -7.025%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_GetCurrentSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-27208.406op/s; -24975.016op/s] or [-13.049%; -11.978%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+10.791%; +10.799%]
  • 🟥 throughput [-24757.682op/s; -23868.597op/s] or [-14.493%; -13.972%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive net6.0

  • 🟥 throughput [-35624.619op/s; -33473.841op/s] or [-14.185%; -13.329%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive netcoreapp3.1

  • 🟥 throughput [-22536.865op/s; -20237.927op/s] or [-11.573%; -10.392%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 allocated_mem [+239 bytes; +240 bytes] or [+25.342%; +25.353%]
  • 🟥 throughput [-88284.936op/s; -85385.281op/s] or [-24.866%; -24.049%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net6.0

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+9.750%; +9.761%]
  • 🟥 throughput [-95350.802op/s; -84799.494op/s] or [-18.092%; -16.090%]

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery netcoreapp3.1

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+9.830%; +9.841%]
  • 🟥 throughput [-87714.108op/s; -79434.980op/s] or [-21.681%; -19.634%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 allocated_mem [+304 bytes; +305 bytes] or [+10.472%; +10.483%]
  • 🟥 throughput [-13808.585op/s; -13459.048op/s] or [-15.763%; -15.364%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net6.0

  • 🟥 allocated_mem [+199 bytes; +200 bytes] or [+9.426%; +9.438%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync netcoreapp3.1

  • 🟥 allocated_mem [+199 bytes; +200 bytes] or [+7.569%; +7.581%]
  • 🟥 throughput [-13351.590op/s; -11819.748op/s] or [-10.595%; -9.380%]

scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog net472

  • 🟥 allocated_mem [+240 bytes; +241 bytes] or [+11.667%; +11.680%]
  • 🟥 throughput [-16238.130op/s; -15021.519op/s] or [-12.439%; -11.507%]

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

  • 🟥 throughput [-16102.003op/s; -11771.406op/s] or [-8.074%; -5.902%]

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

  • 🟥 throughput [-14483.007op/s; -12284.340op/s] or [-9.723%; -8.247%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync netcoreapp3.1

  • unstable execution_time [-28.334ms; -7.893ms] or [-14.150%; -3.942%]

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 net472

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+14.157%; +14.165%]
  • 🟥 throughput [-23817.267op/s; -22490.707op/s] or [-12.532%; -11.834%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.245%; +6.253%]
  • 🟥 throughput [-40525.015op/s; -35170.339op/s] or [-14.184%; -12.310%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.042%; +6.049%]
  • 🟥 throughput [-33081.449op/s; -29819.418op/s] or [-14.985%; -13.507%]

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

  • 🟥 allocated_mem [+231 bytes; +232 bytes] or [+11.840%; +11.849%]
  • 🟥 throughput [-30111.596op/s; -28971.983op/s] or [-17.098%; -16.451%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.136%; +5.144%]
  • 🟥 throughput [-41584.203op/s; -38056.445op/s] or [-15.945%; -14.592%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1

  • 🟥 throughput [-34462.532op/s; -32470.222op/s] or [-17.194%; -16.200%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+14.157%; +14.165%]
  • 🟥 throughput [-29387.929op/s; -27426.375op/s] or [-15.428%; -14.398%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.245%; +6.253%]
  • 🟥 throughput [-43620.649op/s; -37819.095op/s] or [-15.395%; -13.347%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.042%; +6.049%]
  • 🟥 throughput [-40017.747op/s; -37589.541op/s] or [-17.899%; -16.813%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+10.710%; +10.718%]
  • 🟥 throughput [-16469.508op/s; -15736.448op/s] or [-10.715%; -10.238%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0

  • 🟥 throughput [-29049.466op/s; -26785.803op/s] or [-12.536%; -11.559%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1

  • 🟥 throughput [-18678.529op/s; -15983.583op/s] or [-10.553%; -9.030%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+14.157%; +14.165%]
  • 🟥 throughput [-27594.883op/s; -25731.349op/s] or [-14.172%; -13.215%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.245%; +6.253%]
  • 🟥 throughput [-44202.164op/s; -39374.181op/s] or [-14.994%; -13.356%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.042%; +6.049%]
  • 🟥 throughput [-35453.225op/s; -33608.119op/s] or [-15.872%; -15.046%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+14.157%; +14.165%]
  • 🟥 throughput [-30958.049op/s; -30069.892op/s] or [-16.180%; -15.715%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.245%; +6.253%]
  • 🟥 throughput [-50864.729op/s; -48692.292op/s] or [-16.862%; -16.142%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.042%; +6.049%]
  • 🟥 throughput [-34837.901op/s; -32493.099op/s] or [-15.745%; -14.686%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-27439.870op/s; -26298.905op/s] or [-14.937%; -14.315%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-30818.918op/s; -27283.210op/s] or [-11.221%; -9.933%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-33832.669op/s; -30545.756op/s] or [-16.027%; -14.470%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+11.206%; +11.214%]
  • 🟥 throughput [-18180.076op/s; -17221.833op/s] or [-11.361%; -10.763%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.068%; +5.077%]
  • 🟥 throughput [-28911.382op/s; -26989.839op/s] or [-11.673%; -10.897%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1

  • 🟥 throughput [-27465.341op/s; -24932.712op/s] or [-14.299%; -12.981%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-33860.485op/s; -32926.669op/s] or [-18.318%; -17.813%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-32168.429op/s; -26766.705op/s] or [-11.927%; -9.925%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-26819.771op/s; -24187.495op/s] or [-13.105%; -11.819%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+8.106%; +8.114%]
  • 🟥 throughput [-14684.623op/s; -13795.789op/s] or [-12.116%; -11.382%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0

  • 🟥 throughput [-20658.455op/s; -17723.667op/s] or [-11.674%; -10.015%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1

  • 🟥 throughput [-15881.025op/s; -13064.876op/s] or [-11.011%; -9.058%]

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

  • 🟥 allocated_mem [+231 bytes; +232 bytes] or [+10.103%; +10.111%]
  • 🟥 throughput [-18766.293op/s; -17985.921op/s] or [-12.399%; -11.884%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1

  • 🟥 throughput [-26301.788op/s; -24469.247op/s] or [-15.120%; -14.066%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+12.622%; +12.630%]
  • 🟥 throughput [-31888.910op/s; -30886.710op/s] or [-18.003%; -17.437%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.817%; +5.825%]
  • 🟥 throughput [-29870.757op/s; -26399.222op/s] or [-11.728%; -10.365%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.634%; +5.642%]
  • 🟥 throughput [-32226.871op/s; -30973.204op/s] or [-15.965%; -15.344%]

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

  • 🟥 allocated_mem [+232 bytes; +233 bytes] or [+13.195%; +13.203%]
  • 🟥 throughput [-30642.315op/s; -29079.913op/s] or [-16.405%; -15.569%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+6.142%; +6.150%]
  • 🟥 throughput [-40643.482op/s; -35538.155op/s] or [-14.579%; -12.747%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1

  • 🟥 allocated_mem [+87 bytes; +88 bytes] or [+5.944%; +5.952%]
  • 🟥 throughput [-35333.431op/s; -33505.682op/s] or [-16.352%; -15.506%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 allocated_mem [+288 bytes; +289 bytes] or [+7.405%; +7.418%]
  • 🟥 throughput [-15107.715op/s; -14606.932op/s] or [-17.913%; -17.319%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟥 throughput [-11254.750op/s; -8790.641op/s] or [-9.460%; -7.389%]

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

  • 🟥 throughput [-15659.456op/s; -14388.091op/s] or [-15.922%; -14.630%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+1.573KB; +1.573KB] or [+47.789%; +47.804%]
  • 🟥 execution_time [+313.441ms; +316.939ms] or [+155.541%; +157.276%]
  • 🟥 throughput [-62.650op/s; -57.939op/s] or [-11.272%; -10.424%]

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

  • 🟥 allocated_mem [+1.012KB; +1.012KB] or [+37.524%; +37.537%]
  • 🟥 execution_time [+376.113ms; +379.405ms] or [+297.152%; +299.754%]
  • 🟩 throughput [+71.307op/s; +74.124op/s] or [+9.402%; +9.773%]

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

  • 🟥 allocated_mem [+1.088KB; +1.088KB] or [+40.343%; +40.355%]
  • 🟥 execution_time [+398.124ms; +400.404ms] or [+352.324%; +354.343%]

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

  • 🟥 allocated_mem [+4.742KB; +4.742KB] or [+99.823%; +99.838%]
  • 🟥 throughput [-60460.689op/s; -60054.711op/s] or [-47.042%; -46.726%]

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

  • 🟥 allocated_mem [+3.864KB; +3.864KB] or [+81.715%; +81.730%]
  • 🟩 execution_time [-15.726ms; -11.562ms] or [-7.345%; -5.400%]
  • 🟥 throughput [-62209.982op/s; -59447.837op/s] or [-45.410%; -43.394%]

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

  • 🟥 allocated_mem [+4.592KB; +4.592KB] or [+99.295%; +99.306%]
  • 🟥 throughput [-48520.831op/s; -46269.851op/s] or [-43.868%; -41.833%]

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

  • 🟥 allocated_mem [+1.364KB; +1.364KB] or [+110.358%; +110.374%]
  • 🟥 throughput [-280840.191op/s; -275507.140op/s] or [-28.675%; -28.131%]

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

  • 🟥 allocated_mem [+527 bytes; +528 bytes] or [+43.133%; +43.143%]
  • 🟩 execution_time [-27.083ms; -15.202ms] or [-12.078%; -6.780%]
  • 🟥 throughput [-108703.127op/s; -73096.904op/s] or [-11.613%; -7.809%]

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

  • 🟥 allocated_mem [+1.328KB; +1.328KB] or [+109.927%; +109.941%]
  • 🟥 throughput [-191028.820op/s; -161295.282op/s] or [-27.447%; -23.175%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72722.728op/s; -71961.821op/s] or [-48.942%; -48.429%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-76723.937op/s; -72624.551op/s] or [-48.818%; -46.210%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56087.618op/s; -53473.957op/s] or [-44.681%; -42.599%]

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

  • 🟩 execution_time [-19.405ms; -14.981ms] or [-8.945%; -6.906%]

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

  • 🟩 allocated_mem [-13.759KB; -13.756KB] or [-42.324%; -42.316%]
  • 🟥 execution_time [+300.465ms; +301.211ms] or [+150.132%; +150.505%]
  • 🟩 throughput [+1040.924op/s; +1061.651op/s] or [+11.497%; +11.726%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.991ms; +304.096ms] or [+151.790%; +153.357%]
  • 🟩 throughput [+1898.884op/s; +2173.654op/s] or [+14.524%; +16.625%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.272ms; +303.004ms] or [+151.254%; +152.630%]
  • 🟩 throughput [+1765.282op/s; +1895.723op/s] or [+17.043%; +18.302%]

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

  • 🟥 execution_time [+296.892ms; +297.944ms] or [+145.822%; +146.338%]
  • 🟩 throughput [+584.671op/s; +595.746op/s] or [+15.500%; +15.793%]

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

  • 🟥 execution_time [+295.276ms; +296.426ms] or [+144.350%; +144.912%]
  • 🟩 throughput [+2723.835op/s; +2771.367op/s] or [+39.572%; +40.263%]

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

  • 🟥 execution_time [+301.034ms; +302.002ms] or [+150.456%; +150.940%]
  • 🟩 throughput [+1397.842op/s; +1425.944op/s] or [+27.746%; +28.304%]

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

  • 🟩 execution_time [-145.498µs; -140.766µs] or [-29.873%; -28.901%]
  • 🟩 throughput [+838.792op/s; +872.181op/s] or [+40.853%; +42.479%]

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

  • 🟩 execution_time [-126.242µs; -99.037µs] or [-28.954%; -22.714%]
  • 🟩 throughput [+729.681op/s; +861.483op/s] or [+31.724%; +37.454%]

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

  • 🟩 execution_time [-143.204µs; -121.192µs] or [-30.682%; -25.966%]
  • 🟩 throughput [+781.804op/s; +864.993op/s] or [+36.090%; +39.930%]

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

  • 🟩 execution_time [-127.262µs; -122.678µs] or [-34.360%; -33.122%]
  • 🟩 throughput [+1348.709op/s; +1404.849op/s] or [+49.950%; +52.029%]

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

  • 🟩 execution_time [-100.256µs; -76.582µs] or [-32.007%; -24.449%]
  • 🟩 throughput [+1139.716op/s; +1344.828op/s] or [+35.528%; +41.922%]

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

  • 🟩 execution_time [-139.009µs; -116.643µs] or [-38.027%; -31.909%]
  • 🟩 throughput [+1352.600op/s; +1488.602op/s] or [+48.539%; +53.420%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.263ms; +300.993ms] or [+149.862%; +150.227%]

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

  • 🟥 execution_time [+417.423ms; +423.711ms] or [+453.547%; +460.379%]
  • 🟩 throughput [+678.564op/s; +873.806op/s] or [+5.576%; +7.180%]

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

  • unstable execution_time [+198.124ms; +265.360ms] or [+150.434%; +201.486%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+274.842ms; +321.558ms] or [+126.369%; +147.849%]
  • 🟥 throughput [-519.994op/s; -476.142op/s] or [-47.117%; -43.143%]

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

  • unstable execution_time [+209.097ms; +342.359ms] or [+89.108%; +145.899%]
  • 🟥 throughput [-669.444op/s; -585.987op/s] or [-44.652%; -39.085%]

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

  • 🟥 execution_time [+341.761ms; +349.745ms] or [+204.413%; +209.188%]
  • 🟥 throughput [-399.698op/s; -362.767op/s] or [-27.830%; -25.259%]

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

  • 🟩 execution_time [-168.630µs; -124.547µs] or [-8.542%; -6.309%]
  • 🟩 throughput [+35.918op/s; +47.052op/s] or [+7.090%; +9.288%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 allocated_mem [+240 bytes; +241 bytes] or [+30.047%; +30.058%]
  • 🟥 execution_time [+301.471ms; +303.844ms] or [+151.815%; +153.010%]
  • 🟥 throughput [-63591.778op/s; -62026.134op/s] or [-20.462%; -19.959%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+12.114%; +12.124%]
  • 🟥 execution_time [+301.950ms; +303.635ms] or [+151.307%; +152.152%]
  • 🟥 throughput [-127776.895op/s; -122103.930op/s] or [-20.145%; -19.251%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+12.114%; +12.124%]
  • 🟥 execution_time [+301.825ms; +305.817ms] or [+151.624%; +153.630%]
  • 🟥 throughput [-100105.750op/s; -92580.305op/s] or [-21.087%; -19.502%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 allocated_mem [+239 bytes; +240 bytes] or [+27.931%; +27.943%]
  • 🟥 execution_time [+302.582ms; +304.728ms] or [+151.946%; +153.024%]
  • 🟥 throughput [-57739.071op/s; -56112.040op/s] or [-19.344%; -18.798%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+12.493%; +12.506%]
  • 🟥 execution_time [+297.744ms; +299.385ms] or [+147.221%; +148.033%]
  • 🟥 throughput [-142466.279op/s; -136967.630op/s] or [-22.954%; -22.068%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+11.422%; +11.434%]
  • 🟥 execution_time [+302.963ms; +306.930ms] or [+153.555%; +155.566%]
  • 🟥 throughput [-100458.721op/s; -91600.445op/s] or [-21.693%; -19.780%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 allocated_mem [+240 bytes; +241 bytes] or [+27.818%; +27.830%]
  • 🟥 execution_time [+300.431ms; +303.217ms] or [+150.789%; +152.188%]
  • 🟥 throughput [-97597.569op/s; -95961.586op/s] or [-25.319%; -24.895%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+10.618%; +10.631%]
  • 🟥 execution_time [+298.041ms; +301.682ms] or [+148.546%; +150.361%]
  • 🟥 throughput [-81568.424op/s; -76823.116op/s] or [-16.197%; -15.255%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+10.618%; +10.631%]
  • 🟥 execution_time [+298.355ms; +300.991ms] or [+148.429%; +149.740%]
  • 🟥 throughput [-85404.226op/s; -80488.518op/s] or [-20.215%; -19.052%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472

  • 🟥 allocated_mem [+240 bytes; +241 bytes] or [+14.910%; +14.920%]
  • 🟥 throughput [-41215.126op/s; -39539.841op/s] or [-16.574%; -15.900%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+5.627%; +5.636%]
  • 🟩 execution_time [-17.719ms; -13.981ms] or [-8.240%; -6.501%]
  • 🟥 throughput [-42424.973op/s; -35687.048op/s] or [-11.638%; -9.790%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+5.605%; +5.617%]
  • 🟥 throughput [-31502.562op/s; -25726.652op/s] or [-11.499%; -9.391%]

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

  • unstable execution_time [+7.228µs; +50.487µs] or [+1.785%; +12.471%]

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

  • 🟩 allocated_mem [-19.627KB; -19.605KB] or [-7.159%; -7.151%]
  • unstable execution_time [-31.228µs; +26.835µs] or [-6.172%; +5.304%]
  • unstable throughput [-94.346op/s; +107.932op/s] or [-4.708%; +5.386%]

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

  • unstable execution_time [-78.864µs; -18.021µs] or [-13.667%; -3.123%]

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

  • 🟥 execution_time [+6.074µs; +10.189µs] or [+14.357%; +24.083%]
  • 🟥 throughput [-4711.845op/s; -2939.995op/s] or [-19.835%; -12.376%]

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

  • unstable execution_time [-14.122µs; -5.416µs] or [-21.910%; -8.403%]
  • unstable throughput [+1511.436op/s; +3380.301op/s] or [+9.273%; +20.739%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 allocated_mem [+243 bytes; +244 bytes] or [+5.387%; +5.400%]
  • 🟥 execution_time [+303.470ms; +304.872ms] or [+153.391%; +154.099%]

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

  • 🟥 execution_time [+301.927ms; +305.413ms] or [+153.680%; +155.454%]

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

  • 🟥 execution_time [+300.985ms; +303.510ms] or [+150.680%; +151.944%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472

  • 🟥 allocated_mem [+240 bytes; +241 bytes] or [+23.099%; +23.110%]
  • 🟥 throughput [-84043.138op/s; -82596.532op/s] or [-23.265%; -22.865%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+9.226%; +9.238%]
  • 🟥 throughput [-87380.402op/s; -83763.232op/s] or [-16.539%; -15.855%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+9.226%; +9.238%]
  • 🟥 throughput [-93418.471op/s; -85330.371op/s] or [-22.109%; -20.195%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 allocated_mem [+239 bytes; +240 bytes] or [+11.747%; +11.759%]
  • 🟥 execution_time [+298.513ms; +300.581ms] or [+148.782%; +149.813%]
  • 🟥 throughput [-15742.686op/s; -14631.571op/s] or [-10.395%; -9.662%]

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

  • 🟥 allocated_mem [+96 bytes; +96 bytes] or [+6.000%; +6.010%]
  • 🟥 execution_time [+302.188ms; +304.369ms] or [+151.744%; +152.839%]
  • 🟥 throughput [-21938.050op/s; -19840.720op/s] or [-9.541%; -8.628%]

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

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+5.819%; +5.828%]
  • 🟥 execution_time [+303.408ms; +306.414ms] or [+153.869%; +155.393%]
  • 🟥 throughput [-16860.655op/s; -14522.445op/s] or [-9.496%; -8.179%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.672ms; +300.617ms] or [+149.478%; +149.949%]
  • 🟩 throughput [+66074285.102op/s; +66481356.423op/s] or [+48.119%; +48.416%]

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

  • unstable execution_time [+339.970ms; +401.230ms] or [+422.813%; +499.000%]

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

  • 🟥 execution_time [+299.688ms; +300.773ms] or [+149.478%; +150.018%]
  • 🟩 throughput [+18065438.153op/s; +19047896.002op/s] or [+8.002%; +8.437%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472

  • 🟥 throughput [-106718.088op/s; -104230.387op/s] or [-11.910%; -11.632%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472

  • 🟥 throughput [-151124.592op/s; -146470.781op/s] or [-13.834%; -13.408%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472

  • 🟥 throughput [-25480.248op/s; -22576.647op/s] or [-5.677%; -5.030%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

  • 🟥 allocated_mem [+239 bytes; +240 bytes] or [+39.335%; +39.349%]
  • 🟥 throughput [-232904.777op/s; -229224.957op/s] or [-34.087%; -33.548%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+14.810%; +14.823%]
  • 🟥 throughput [-210232.966op/s; -193531.338op/s] or [-23.488%; -21.622%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

  • 🟥 allocated_mem [+95 bytes; +96 bytes] or [+14.810%; +14.821%]
  • 🟥 throughput [-185755.907op/s; -171107.503op/s] or [-25.936%; -23.891%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0
  • 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.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1

@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
Comment on lines +277 to +290
var relevantSpanIds = otlpSpans.Select(s => s.SpanId).ToHashSet();
var tracesRequests = new JArray(
Fixture.Agent.OtlpTraceRequests
.Where(r => r.Spans.Any(s => relevantSpanIds.Contains(s.SpanId)))
.Select(r => JToken.Parse(JsonFormatter.Default.Format(r.Raw))));

foreach (var scopeSpan in tracesRequests.SelectTokens($"$..{names.ScopeSpans}[*]"))
{
if (scopeSpan["spans"] is JArray spans)
{
scopeSpan["spans"] = new JArray(
spans.Where(s => relevantSpanIds.Contains(HexString.ToHexString(Convert.FromBase64String(s[names.SpanId]!.ToString())))));
}
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, feels like we shouldn't need this to be so complicated. It should just follow our general mockspan code flow.

chojomok and others added 15 commits September 3, 2026 13:53
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>
- 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>
DateTimeOffset.UnixEpoch was added in .NET Core 2.1+ and isn't
available on the net48 target Datadog.Trace.TestHelpers also builds
for, breaking CI compilation across every dependent test project.
Construct the epoch directly instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace the JSON-envelope reconstruction in OtlpAspNetCoreTestBase
(correlate span IDs against re-parsed JSON, trim JArrays by decoding
base64 IDs back to hex) with two additions:

- MockTracerAgent.WaitForOtlpTraceRequestsAsync: like
  WaitForOtlpSpansAsync, but returns the MockOtlpTraceRequests that
  produced the matching spans, each already trimmed to just those
  spans, instead of a flat span list. The ID correlation this requires
  now happens once, in one place, on the typed protobuf model (hex
  comparison) rather than per-test-file after a JSON round-trip.
- OtlpSnapshotHelper.MergeMockOtlpTraceRequests /
  GetAttributeStringValue(OtlpSpan, ...): typed counterparts to
  MergeDatadogRequests/GetAttributeStringValue(JToken, ...), merging
  and sorting multiple requests on the protobuf model before ever
  touching JSON, instead of after formatting. This also removes the
  need to stash/restore each span's real start time around
  normalization, since sorting by real timestamps now happens before
  NormalizeSpans replaces them with a placeholder.

The original JToken-based OtlpSnapshotHelper members are unchanged and
still used by suites reading raw JSON from the Docker ddapm-test-agent
(e.g. OpenTelemetrySdkTests) -- these are additive, not a replacement.

Verified against all 108 OtlpAspNetCoreMvc31Tests/OtlpAspNetCoreMinimalApisTests
cases: all pass with zero snapshot changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…f Docker

Alternate approach to the additive one in otlp-http-mocktracer: instead
of keeping the JToken-based OtlpSnapshotHelper methods alongside new
typed ones, update them in place (MergeDatadogRequests and
GetAttributeStringValue now take the typed MockOtlp model; the old
JToken overloads and the unused SetAttributeStringValue are deleted).

OpenTelemetryWebRequestTests and OpenTelemetryHttpClientTests are fully
migrated off the Docker ddapm-test-agent onto MockTracerAgent -- both
verified passing locally against unmodified snapshots.

OpenTelemetrySdkTests.SubmitsOtlpTraces is migrated too (its sibling
methods SubmitsOtlpMetrics/SubmitsOtlpRuntimeMetrics/SubmitsOtlpLogs
stay on Docker: gRPC + metrics/logs decoding are still non-goals for
MockTracerAgent's OTLP support), but its existing snapshots do NOT yet
match:
- doubleValue formatting differs ("1" vs "1.0") -- Google.Protobuf's
  JsonFormatter renders whole-number doubles without a trailing ".0",
  the old ddapm-agent rendering (or the scrubber pipeline) apparently
  preserved it.
- Span content/order mismatch in the non-Datadog-SDK (otelTracesEnabled)
  branch -- span identity looks scrambled relative to the verified
  file, needs investigation (likely a merge/sort or scope-grouping
  difference between the old JToken-array-of-requests shape and the
  new typed-then-formatted approach for that branch specifically).

Still TODO before this is mergeable:
- Root-cause and fix both diffs above.
- Decide whether to regenerate OpenTelemetrySdkTests.SubmitsOtlpTraces*
  snapshots (likely required for the doubleValue formatting change,
  which is a legitimate representation difference, not a bug) vs. fix
  in code (the span-order issue is likely a real bug to fix, not a
  snapshot update).
- OpenTelemetrySdkTests.SubmitsOtlpTraces only spot-tested with
  packageVersion="" (default); not yet run across the full
  GetOtlpTracesTestData() matrix (multiple OTel SDK package versions).
- Not yet pushed / no PR opened for this branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two real bugs found while validating the migration, both fixed:

- MergeDatadogRequests's default span sort used StringComparer.Ordinal,
  but the original JToken-based implementation used a bare OrderBy
  (culture-aware default comparer). Ordinal reorders names that differ
  only by the case of a leading letter (e.g. "SomeSpan" vs
  "some.name"), which looked like a real span-identity mismatch
  against existing snapshots. Dropped the explicit comparer to match
  the original default exactly.
- AddProtobufToJsonScrubbers (which converts protobuf's enum-as-string
  rendering, e.g. "SPAN_KIND_INTERNAL", to the int form existing
  snapshots expect) was only called for http/protobuf rows. Since
  MockTracerAgent always re-serializes via Google.Protobuf's
  JsonFormatter regardless of which wire protocol the request arrived
  over, that mismatch now shows up on every row, not just protobuf
  ones -- call it unconditionally, matching every other migrated
  suite.

Also added a scrubber for a real formatting difference: JsonFormatter
renders a whole-number double as "1" rather than the "1.0" existing
snapshots expect (both are valid representations of the same double
value).

All 8 SubmitsOtlpTraces rows (all protocol/backup/semantics
combinations) now pass against the existing, unmodified snapshots.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Keep wording close to main where it already existed; tighten new
comments to be proportional to the code they explain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chojomok
chojomok force-pushed the otlp-http-mocktracer branch from a1e10f7 to 641fa0f Compare September 3, 2026 17:56
WaitForOtlpTraceRequestsAsync(count: 1) only checked that some export
had landed, not that the whole trace had. Pass the real expected count
(8 for WebRequestTests/HttpClientTests, 38 for SdkTests) and assert
against it, matching the snapshots and the WaitForSpansAsync pattern.
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