Skip to content

[Tracing] Add experimental http/protobuf support for OTLP traces export#8645

Merged
zacharycmontoya merged 33 commits into
masterfrom
zach.montoya/otlp-traces-protobuf
May 22, 2026
Merged

[Tracing] Add experimental http/protobuf support for OTLP traces export#8645
zacharycmontoya merged 33 commits into
masterfrom
zach.montoya/otlp-traces-protobuf

Conversation

@zacharycmontoya

@zacharycmontoya zacharycmontoya commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Adds http/protobuf support to the OTLP traces exporter introduced in #8211, which introduced the exporter and http/json support.

This feature is enabled by setting OTEL_TRACES_EXPORTER=otlp and OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf (or the parent OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf).

Reason for change

When #8211 landed, http/json was the only functional OTLP traces protocol — setting any other protocol would fall back (with a log message) to the Datadog MessagePack encoding.

http/protobuf is the OTLP default protocol per the OpenTelemetry specification and is what most OTel collectors, Datadog Agent included, expect to receive, so we need to support it to be useful out-of-the-box for users adopting the OTLP traces export.

Implementation details

Serializer

Adds Datadog.Trace.OpenTelemetry.Traces.OtlpTracesProtobufSerializer, a new ISpanBufferSerializer that emits the OTLP ExportTraceServiceRequest protobuf payload directly into SpanBuffer's output buffer:

  • The resource_spans and scope_spans envelopes are opened on the first SerializeSpans call, span entries are appended per chunk, and FinishBody patches the two length-prefix placeholders using absolute positions into the destination buffer.
  • The serializer respects the same per-span / per-event / per-link attribute count limits (128) as OtlpTracesJsonSerializer, and re-uses the OtlpMapper logic to map resource attributes and tags onto the serialized spans.
  • OtlpTracesProtobufSerializer is stateful (it tracks the two length-placeholder positions), so AgentWriter now creates a fresh instance for the front and back buffers rather than sharing one — the previous shared OtlpTracesJsonSerializer was stateless and didn't need this.

Vendored OpenTelemetry SDK

Builds on the protobuf primitives vendored from the OpenTelemetry .NET SDK in #7653 (ProtobufSerializer, ProtobufWireType):

  • Adds new field-number constant files: ProtobufOtlpTraceFieldNumberConstants and ProtobufOtlpResourceFieldNumberConstants (split out so the OTLP trace serializer only depends on what it needs).
  • Removes the #if NETCOREAPP3_1_OR_GREATER guard from the vendored ProtobufSerializer — now that we vendor a Span<> polyfill the serializer compiles and runs on all supported runtimes (.NET Framework 4.6.1+).
  • Drops the matching #if NET6_0_OR_GREATER guard around the SubmitsOtlpTraces integration test (http/protobuf and http/json both run on .NET Framework now too).

Wiring

  • ExporterSettings: OtlpProtocol.HttpProtobuf now resolves to TracesEncoding.OtlpProtobuf instead of falling back to DatadogV0_4.
  • AgentWriter.GetSpanSerializer: selects OtlpTracesProtobufSerializer when TracesEncoding == OtlpProtobuf.
  • ApiOtlp.SendTracesAsync: chooses application/x-protobuf vs application/json for the request Content-Type based on _tracesEncoding. Adds the application/x-protobuf MIME type constant to Datadog.Trace.Agent.Transports.MimeTypes.
  • supported-configurations.yaml: documents http/protobuf as a valid value for OTEL_EXPORTER_OTLP_TRACES_PROTOCOL and regenerates ConfigurationKeys.OpenTelemetry.g.cs for all TFMs.

Test coverage

  • Unit tests: New OtlpTracesProtobufSerializerTests exercises the serializer end-to-end using Google.Protobuf and a little custom parsing. Test cases include:
    • Empty buffer (FinishBody returns 0)
    • Multiple traces reported in a single-chunk
    • Serializing span events/links/status
    • Exceeding buffer maxSize honoring behavior
    • Exceeding span limits
  • Integration tests: OpenTelemetrySdkTests.SubmitsOtlpTraces now runs both http/json and http/protobuf cases for the Datadog SDK on all TFMs.
  • Snapshot unification: To keep one Datadog-SDK snapshot regardless of OTLP protocol, snapshots for http/protobuf are normalized to the http/json shape via scrubbers that translate the test agent's protobuf rendering (snake_case field names, string-form enum values like SPAN_KIND_SERVER) into the JSON serializer's shape (camelCase field names, integer enum values).
  • Snapshot rename: SubmitsOtlpTraces_DD_http_json.verified.txt renamed to SubmitsOtlpTraces_DD.verified.txt (one snapshot now covers both protocols).

Other details

With this PR, http/json and http/protobuf are both functional; grpc still falls back to Datadog MessagePack encoding with a startup warning.

Follow-up work

  • Implement the grpc OTLP traces protocol
  • Add OTLP traces telemetry counts (the TODO: Telemetry - Record OTLP Traces API submissions in ApiOtlp.SendTracesAsync still applies)
  • Honor OTEL_EXPORTER_OTLP_TRACES_TIMEOUT in ApiOtlp (still unused)

zacharycmontoya and others added 17 commits May 13, 2026 10:02
Empty skeleton files for the OTLP traces protobuf serializer and its tests,
to be filled in via subsequent TDD cycles.
Implements the empty-buffer path: when no spans have been serialized,
FinishBody is a no-op that returns 0 bytes written.
Implements SerializeSpans for the first-chunk path: opens the
ResourceSpans envelope (resource + scope_spans), then writes each span
with its trace_id/span_id/parent_span_id/name/kind/timestamps,
attributes, events, links, status, and flags. FinishBody patches the
length placeholders.

Tests parse the binary output via Google.Protobuf.CodedInputStream
through a minimal in-test decoder so we avoid taking a heavy generated-
bindings dependency.
…r positions

Mirror the JSON serializer's overflow behavior: return 0 from
SerializeSpans when the chunk exceeds maxSize, and grow the caller's
temporary buffer up-front via MessagePackBinary.EnsureCapacity so
per-field writes cannot IndexOutOfRangeException.

Store length-placeholder positions as offsets into the eventual
destination _buffer (computed via spanBufferOffset), not as absolute
offsets into the temporary serialization buffer. This removes implicit
coupling to HeaderSize == 0 and temporaryBufferOffset == 0.

Add a unit test that exercises the maxSize overflow path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ew Traces http/protobuf implementation to run on all runtimes. This also removes the '#if NETCOREAPP3_1_OR_GREATER' from the vendored OpenTelemetry .NET SDK ProtobufSerializer
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented May 14, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration72.38 ± (72.45 - 72.81) ms73.03 ± (73.06 - 73.40) ms+0.9%✅⬆️
.NET Framework 4.8 - Bailout
duration77.37 ± (77.32 - 77.80) ms76.75 ± (76.64 - 77.00) ms-0.8%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1108.72 ± (1107.14 - 1113.14) ms1111.37 ± (1109.72 - 1117.65) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.52 ± (22.47 - 22.56) ms22.50 ± (22.45 - 22.54) ms-0.1%
process.time_to_main_ms85.18 ± (84.94 - 85.43) ms84.28 ± (84.10 - 84.47) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.92 ± (10.92 - 10.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.72 ± (22.66 - 22.78) ms22.66 ± (22.60 - 22.72) ms-0.3%
process.time_to_main_ms89.07 ± (88.75 - 89.39) ms88.80 ± (88.45 - 89.15) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.95) MB10.95 ± (10.95 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms214.68 ± (213.75 - 215.60) ms214.57 ± (213.67 - 215.47) ms-0.1%
process.time_to_main_ms544.34 ± (542.97 - 545.70) ms544.73 ± (543.27 - 546.18) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.57 ± (48.54 - 48.61) MB48.56 ± (48.53 - 48.59) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.13 ± (21.08 - 21.17) ms21.30 ± (21.26 - 21.34) ms+0.8%✅⬆️
process.time_to_main_ms73.77 ± (73.59 - 73.94) ms74.10 ± (73.93 - 74.27) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.64 ± (10.64 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.59 ± (21.53 - 21.65) ms21.08 ± (21.05 - 21.12) ms-2.3%
process.time_to_main_ms78.13 ± (77.86 - 78.40) ms74.68 ± (74.51 - 74.85) ms-4.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.73) MB10.75 ± (10.75 - 10.76) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms367.73 ± (365.79 - 369.68) ms368.23 ± (366.11 - 370.36) ms+0.1%✅⬆️
process.time_to_main_ms550.27 ± (548.96 - 551.57) ms550.71 ± (549.24 - 552.18) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.98 ± (49.96 - 50.00) MB50.03 ± (50.01 - 50.06) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.48 ± (19.44 - 19.51) ms19.82 ± (19.75 - 19.89) ms+1.8%✅⬆️
process.time_to_main_ms72.74 ± (72.57 - 72.91) ms75.18 ± (74.89 - 75.46) ms+3.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.66) MB7.69 ± (7.68 - 7.69) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.44 ± (19.40 - 19.47) ms19.50 ± (19.46 - 19.53) ms+0.3%✅⬆️
process.time_to_main_ms73.69 ± (73.51 - 73.87) ms74.38 ± (74.18 - 74.58) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.71 - 7.72) MB7.73 ± (7.73 - 7.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms299.00 ± (297.08 - 300.93) ms291.82 ± (288.75 - 294.90) ms-2.4%
process.time_to_main_ms500.88 ± (499.70 - 502.06) ms500.68 ± (498.78 - 502.58) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.87 ± (36.84 - 36.90) MB36.91 ± (36.87 - 36.94) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.6%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration198.25 ± (197.84 - 198.83) ms197.61 ± (197.63 - 198.59) ms-0.3%
.NET Framework 4.8 - Bailout
duration200.76 ± (200.57 - 201.35) ms201.54 ± (200.83 - 201.65) ms+0.4%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1180.62 ± (1182.34 - 1190.86) ms1186.84 ± (1186.71 - 1192.54) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms191.66 ± (191.12 - 192.20) ms191.51 ± (191.04 - 191.99) ms-0.1%
process.time_to_main_ms83.57 ± (83.21 - 83.94) ms82.87 ± (82.64 - 83.10) ms-0.8%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.06 ± (16.04 - 16.09) MB16.10 ± (16.08 - 16.12) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms190.99 ± (190.57 - 191.40) ms191.57 ± (191.07 - 192.08) ms+0.3%✅⬆️
process.time_to_main_ms84.31 ± (84.07 - 84.55) ms84.45 ± (84.21 - 84.69) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.13 - 16.17) MB16.10 ± (16.07 - 16.13) MB-0.3%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms382.43 ± (381.29 - 383.56) ms385.90 ± (384.76 - 387.03) ms+0.9%✅⬆️
process.time_to_main_ms535.59 ± (534.44 - 536.74) ms533.35 ± (531.97 - 534.73) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.12 ± (57.03 - 57.21) MB57.34 ± (57.17 - 57.51) MB+0.4%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms195.35 ± (194.94 - 195.76) ms196.42 ± (195.94 - 196.91) ms+0.6%✅⬆️
process.time_to_main_ms71.78 ± (71.50 - 72.05) ms71.59 ± (71.36 - 71.81) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.37 ± (16.34 - 16.39) MB16.35 ± (16.33 - 16.38) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 6 - Bailout
process.internal_duration_ms195.31 ± (194.85 - 195.77) ms195.62 ± (195.13 - 196.12) ms+0.2%✅⬆️
process.time_to_main_ms72.53 ± (72.31 - 72.76) ms72.44 ± (72.24 - 72.63) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.19 - 16.41) MB16.42 ± (16.40 - 16.45) MB+0.8%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+1.4%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms586.29 ± (583.62 - 588.96) ms581.32 ± (578.27 - 584.37) ms-0.8%
process.time_to_main_ms542.00 ± (540.93 - 543.06) ms539.84 ± (538.86 - 540.82) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.16 ± (61.06 - 61.27) MB61.10 ± (61.02 - 61.18) MB-0.1%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.2%
.NET 8 - Baseline
process.internal_duration_ms195.24 ± (194.85 - 195.63) ms194.77 ± (194.36 - 195.19) ms-0.2%
process.time_to_main_ms71.51 ± (71.32 - 71.69) ms71.64 ± (71.41 - 71.87) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.69 ± (11.67 - 11.70) MB11.78 ± (11.76 - 11.80) MB+0.8%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms193.67 ± (193.36 - 193.99) ms194.19 ± (193.73 - 194.66) ms+0.3%✅⬆️
process.time_to_main_ms72.50 ± (72.33 - 72.66) ms72.43 ± (72.21 - 72.65) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.73 - 11.77) MB11.81 ± (11.79 - 11.83) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.4%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms513.20 ± (510.40 - 515.99) ms510.57 ± (508.21 - 512.93) ms-0.5%
process.time_to_main_ms491.80 ± (490.97 - 492.64) ms489.92 ± (489.11 - 490.72) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.63 ± (50.59 - 50.67) MB50.63 ± (50.59 - 50.67) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.5%
Comparison explanation

Execution-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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8645) - mean (73ms)  : 71, 76
    master - mean (73ms)  : 70, 75

    section Bailout
    This PR (8645) - mean (77ms)  : 75, 79
    master - mean (78ms)  : 74, 81

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (1,114ms)  : 1053, 1174
    master - mean (1,110ms)  : 1067, 1153

Loading
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 (8645) - mean (114ms)  : 110, 117
    master - mean (115ms)  : 110, 119

    section Bailout
    This PR (8645) - mean (118ms)  : 112, 125
    master - mean (119ms)  : 113, 125

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (797ms)  : 771, 823
    master - mean (796ms)  : 771, 821

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8645) - mean (102ms)  : 99, 105
    master - mean (101ms)  : 98, 105

    section Bailout
    This PR (8645) - mean (102ms)  : 100, 104
    master - mean (106ms)  : 101, 112

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (949ms)  : 912, 985
    master - mean (947ms)  : 905, 989

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8645) - mean (103ms)  : 98, 109
    master - mean (100ms)  : 96, 104

    section Bailout
    This PR (8645) - mean (102ms)  : 98, 105
    master - mean (101ms)  : 98, 103

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (826ms)  : 777, 875
    master - mean (829ms)  : 789, 869

Loading
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 (8645) - mean (198ms)  : 192, 204
    master - mean (198ms)  : 192, 205

    section Bailout
    This PR (8645) - mean (201ms)  : 197, 205
    master - mean (201ms)  : 197, 205

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (1,190ms)  : 1149, 1230
    master - mean (1,187ms)  : 1132, 1241

Loading
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 (8645) - mean (283ms)  : 273, 293
    master - mean (284ms)  : 276, 293

    section Bailout
    This PR (8645) - mean (285ms)  : 278, 293
    master - mean (284ms)  : 278, 290

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (958ms)  : 939, 977
    master - mean (957ms)  : 939, 975

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8645) - mean (277ms)  : 269, 284
    master - mean (276ms)  : 270, 281

    section Bailout
    This PR (8645) - mean (277ms)  : 270, 283
    master - mean (276ms)  : 270, 282

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (1,150ms)  : 1105, 1195
    master - mean (1,156ms)  : 1114, 1199

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8645) - mean (276ms)  : 270, 283
    master - mean (277ms)  : 268, 285

    section Bailout
    This PR (8645) - mean (277ms)  : 271, 282
    master - mean (276ms)  : 272, 280

    section CallTarget+Inlining+NGEN
    This PR (8645) - mean (1,032ms)  : 996, 1069
    master - mean (1,037ms)  : 988, 1087

Loading

@pr-commenter

pr-commenter Bot commented May 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-22 19:05:54

Comparing candidate commit a1da8e6 in PR branch zach.montoya/otlp-traces-protobuf with baseline commit dc3f873 in branch master.

Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥
Check Gitlab CI job log to find if any benchmark has crashed.

Scenarios present only in baseline:

  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1

Found 6 performance improvements and 10 performance regressions! Performance is the same for 43 metrics, 13 unstable metrics, 93 known flaky benchmarks, 33 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

  • 🟥 throughput [-11247.487op/s; -10143.633op/s] or [-5.861%; -5.286%]

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

  • 🟩 execution_time [-70.941ms; -54.426ms] or [-35.235%; -27.032%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟥 throughput [-88353.591op/s; -84997.135op/s] or [-33.243%; -31.980%]
  • 🟩 execution_time [-79.916ms; -77.765ms] or [-39.707%; -38.638%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟥 throughput [-93150.464op/s; -87849.917op/s] or [-34.872%; -32.887%]
  • 🟩 execution_time [-76.876ms; -73.350ms] or [-38.012%; -36.268%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟥 throughput [-105419.034op/s; -100040.494op/s] or [-37.985%; -36.047%]
  • 🟩 execution_time [-77.642ms; -76.018ms] or [-38.860%; -38.047%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+7.889%; +7.898%]
  • 🟥 throughput [-109367.308op/s; -94855.835op/s] or [-43.370%; -37.615%]

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

  • 🟩 execution_time [-113.095ms; -111.988ms] or [-56.273%; -55.722%]

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

  • 🟥 throughput [-70348.197op/s; -64303.204op/s] or [-47.789%; -43.682%]
  • 🟩 execution_time [-39.818ms; -25.531ms] or [-19.760%; -12.669%]

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 net6.0

  • 🟩 execution_time [-70.674ms; -51.353ms] or [-35.241%; -25.607%]
  • 🟥 throughput [-113148.041op/s; -94921.748op/s] or [-40.483%; -33.962%]

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

  • unstable execution_time [-100.497ms; -76.193ms] or [-50.006%; -37.913%]

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

  • 🟩 execution_time [-74.236ms; -70.720ms] or [-36.994%; -35.242%]
  • 🟥 throughput [-101712.251op/s; -95955.091op/s] or [-38.946%; -36.742%]

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

  • 🟩 execution_time [-110.479ms; -109.099ms] or [-54.988%; -54.301%]

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

  • 🟩 execution_time [-68.813ms; -67.412ms] or [-34.525%; -33.822%]
  • 🟥 throughput [-101652.595op/s; -97801.479op/s] or [-36.084%; -34.717%]

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

  • unstable execution_time [-101.145ms; -76.375ms] or [-50.886%; -38.424%]

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

  • unstable execution_time [-51.493ms; -22.285ms] or [-25.803%; -11.167%]
  • 🟥 throughput [-110612.685op/s; -94988.127op/s] or [-48.677%; -41.801%]

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

  • 🟩 execution_time [-109.477ms; -108.093ms] or [-54.962%; -54.267%]

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

  • unstable execution_time [-56.410ms; -34.942ms] or [-28.215%; -17.477%]
  • unstable throughput [-128679.818op/s; -89456.277op/s] or [-44.371%; -30.846%]

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

  • unstable execution_time [-101.855ms; -76.610ms] or [-50.901%; -38.285%]

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

  • unstable execution_time [-71.238ms; -34.472ms] or [-35.598%; -17.226%]
  • 🟥 throughput [-129107.147op/s; -103154.955op/s] or [-43.499%; -34.755%]

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

  • 🟩 execution_time [-109.196ms; -107.426ms] or [-54.668%; -53.782%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟩 execution_time [-69.610ms; -51.773ms] or [-34.655%; -25.775%]
  • 🟥 throughput [-122557.378op/s; -106176.890op/s] or [-43.800%; -37.946%]

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

  • 🟩 execution_time [-112.418ms; -110.952ms] or [-55.717%; -54.990%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+8.332%; +8.340%]
  • unstable execution_time [-50.381ms; -14.439ms] or [-25.145%; -7.207%]
  • 🟥 throughput [-132127.615op/s; -111232.316op/s] or [-52.651%; -44.324%]

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

  • unstable execution_time [-103.289ms; -78.063ms] or [-51.455%; -38.888%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • unstable execution_time [-48.488ms; -14.015ms] or [-24.211%; -6.998%]
  • 🟥 throughput [-125108.909op/s; -104683.827op/s] or [-46.713%; -39.087%]

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

  • 🟩 execution_time [-114.512ms; -112.380ms] or [-57.099%; -56.036%]

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

  • 🟩 execution_time [-94.900ms; -78.872ms] or [-47.336%; -39.341%]
  • unstable throughput [-54166.097op/s; -36374.216op/s] or [-30.998%; -20.816%]

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

  • 🟩 execution_time [-115.331ms; -114.027ms] or [-56.806%; -56.164%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+7.434%; +7.442%]
  • unstable execution_time [-39.781ms; -12.018ms] or [-19.926%; -6.020%]
  • 🟥 throughput [-108485.051op/s; -95804.988op/s] or [-49.739%; -43.926%]

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

  • unstable execution_time [-96.111ms; -72.755ms] or [-47.865%; -36.233%]

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

  • unstable execution_time [-54.694ms; -34.206ms] or [-27.315%; -17.083%]
  • 🟥 throughput [-124153.465op/s; -111876.096op/s] or [-46.971%; -42.326%]

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

  • unstable execution_time [-104.260ms; -78.335ms] or [-51.631%; -38.792%]

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

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟩 execution_time [-68.304ms; -49.883ms] or [-34.131%; -24.926%]
  • 🟥 throughput [-106737.778op/s; -103220.786op/s] or [-37.831%; -36.585%]

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

  • unstable execution_time [-80.971ms; -49.666ms] or [-40.752%; -24.997%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-7278.092op/s; -6745.342op/s] or [-8.630%; -7.998%]

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

  • unstable execution_time [-15.679ms; +23.333ms] or [-7.822%; +11.641%]
  • unstable throughput [-64507.754op/s; -49469.256op/s] or [-54.221%; -41.581%]

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

  • unstable execution_time [-53.561ms; -24.875ms] or [-26.940%; -12.512%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+307.868ms; +323.177ms] or [+152.775%; +160.372%]
  • 🟥 throughput [-60.003op/s; -46.875op/s] or [-10.796%; -8.434%]

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

  • 🟥 execution_time [+99.884ms; +101.805ms] or [+78.914%; +80.432%]
  • 🟩 throughput [+82.510op/s; +89.474op/s] or [+10.879%; +11.797%]

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

  • 🟥 execution_time [+86.597ms; +88.062ms] or [+76.635%; +77.932%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

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

  • 🟥 allocated_mem [+439 bytes; +440 bytes] or [+9.299%; +9.310%]
  • 🟩 execution_time [-55.068ms; -34.878ms] or [-25.719%; -16.289%]
  • unstable throughput [-29784.646op/s; -15067.133op/s] or [-21.741%; -10.998%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.500%; +27.510%]
  • 🟩 execution_time [-47.735ms; -27.005ms] or [-22.731%; -12.859%]

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-264548.251op/s; -258370.785op/s] or [-27.012%; -26.381%]

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

  • 🟥 allocated_mem [+439 bytes; +440 bytes] or [+35.945%; +35.954%]
  • unstable execution_time [-94.721ms; -67.590ms] or [-42.241%; -30.142%]
  • unstable throughput [-258868.685op/s; -139091.962op/s] or [-27.655%; -14.859%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • unstable execution_time [-66.230ms; -41.054ms] or [-33.059%; -20.493%]
  • 🟥 throughput [-130041.803op/s; -109968.573op/s] or [-18.685%; -15.800%]

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

  • 🟩 execution_time [-61.205ms; -57.543ms] or [-30.881%; -29.034%]

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

  • 🟩 execution_time [-61.859ms; -45.028ms] or [-31.538%; -22.957%]
  • 🟩 throughput [+10319.040op/s; +12988.887op/s] or [+8.220%; +10.347%]

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

  • unstable execution_time [-59.137ms; -36.771ms] or [-29.239%; -18.180%]
  • unstable throughput [-256775.888op/s; +115716.415op/s] or [-8.562%; +3.858%]

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

  • unstable execution_time [-63.966ms; -38.800ms] or [-29.486%; -17.885%]
  • 🟩 throughput [+148852.016op/s; +204800.986op/s] or [+5.908%; +8.129%]

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

  • 🟥 execution_time [+301.504ms; +315.429ms] or [+150.651%; +157.609%]

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

  • unstable execution_time [+144.343ms; +182.400ms] or [+72.792%; +91.985%]

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

  • unstable execution_time [+215.976ms; +261.961ms] or [+108.792%; +131.956%]

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

  • 🟥 execution_time [+297.248ms; +311.037ms] or [+145.997%; +152.769%]

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

  • 🟥 execution_time [+241.778ms; +258.300ms] or [+118.196%; +126.274%]

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

  • 🟥 execution_time [+284.000ms; +297.070ms] or [+141.943%; +148.475%]

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

  • 🟥 allocated_mem [+24.647KB; +24.648KB] or [+541.479%; +541.512%]

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

  • 🟥 execution_time [+22.264µs; +45.941µs] or [+7.108%; +14.667%]
  • 🟥 throughput [-427.897op/s; -228.688op/s] or [-13.339%; -7.129%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.737ms; +300.671ms] or [+149.600%; +150.065%]

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

  • unstable execution_time [+351.568ms; +366.257ms] or [+381.993%; +397.953%]
  • 🟥 throughput [-6824.628op/s; -6642.257op/s] or [-56.079%; -54.580%]

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

  • unstable execution_time [+208.436ms; +250.422ms] or [+158.263%; +190.143%]
  • 🟥 throughput [-1358.635op/s; -1120.702op/s] or [-13.152%; -10.849%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+311.000ms; +327.543ms] or [+142.995%; +150.601%]
  • 🟥 throughput [-688.100op/s; -670.645op/s] or [-62.349%; -60.767%]

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

  • unstable execution_time [-57.858ms; +75.777ms] or [-24.657%; +32.293%]
  • 🟥 throughput [-685.550op/s; -596.477op/s] or [-45.726%; -39.785%]

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

  • 🟥 allocated_mem [+2.305KB; +2.308KB] or [+5.442%; +5.450%]
  • 🟥 execution_time [+339.700ms; +347.587ms] or [+203.180%; +207.898%]
  • 🟥 throughput [-726.393op/s; -692.066op/s] or [-50.578%; -48.188%]

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

  • 🟩 throughput [+34.734op/s; +38.394op/s] or [+5.056%; +5.589%]

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

  • 🟩 execution_time [-66.514µs; -59.232µs] or [-6.169%; -5.493%]
  • 🟩 throughput [+54.147op/s; +60.880op/s] or [+5.838%; +6.564%]

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

  • 🟩 execution_time [-220.532µs; -206.629µs] or [-11.171%; -10.467%]
  • 🟩 throughput [+59.331op/s; +63.796op/s] or [+11.712%; +12.594%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.558ms; +315.177ms] or [+152.866%; +158.717%]

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

  • 🟥 execution_time [+237.369ms; +252.281ms] or [+118.946%; +126.418%]

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

  • 🟥 execution_time [+299.419ms; +304.788ms] or [+150.416%; +153.113%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+304.741ms; +318.748ms] or [+153.031%; +160.065%]

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

  • 🟥 execution_time [+186.669ms; +197.049ms] or [+92.300%; +97.432%]

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

  • 🟥 execution_time [+301.913ms; +309.216ms] or [+153.023%; +156.724%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.516ms; +314.886ms] or [+151.836%; +158.044%]

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

  • 🟥 execution_time [+306.026ms; +313.437ms] or [+152.526%; +156.220%]
  • 🟩 throughput [+26292.947op/s; +38923.255op/s] or [+5.221%; +7.729%]

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

  • 🟥 execution_time [+299.619ms; +305.912ms] or [+149.058%; +152.188%]

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

  • unstable execution_time [-90.044ms; -62.062ms] or [-41.871%; -28.859%]
  • unstable throughput [-103300.193op/s; -55641.082op/s] or [-28.338%; -15.264%]

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

  • unstable execution_time [-74.304ms; -45.345ms] or [-37.272%; -22.746%]

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

  • 🟩 allocated_mem [-18.226KB; -18.204KB] or [-6.648%; -6.640%]
  • unstable execution_time [-76.505µs; -21.937µs] or [-15.121%; -4.336%]
  • 🟩 throughput [+108.082op/s; +305.247op/s] or [+5.393%; +15.232%]

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

  • 🟩 allocated_mem [-24.796KB; -24.778KB] or [-9.039%; -9.033%]
  • 🟩 execution_time [-92.859µs; -36.626µs] or [-16.092%; -6.347%]
  • 🟩 throughput [+134.388op/s; +288.780op/s] or [+7.678%; +16.498%]

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

  • unstable execution_time [+3.656µs; +8.951µs] or [+8.641%; +21.158%]
  • 🟥 throughput [-3878.897op/s; -1822.393op/s] or [-16.329%; -7.672%]

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

  • unstable execution_time [-13.350µs; -3.648µs] or [-20.712%; -5.660%]
  • unstable throughput [+1191.328op/s; +3175.555op/s] or [+7.309%; +19.483%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+304.889ms; +319.074ms] or [+154.108%; +161.278%]

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

  • 🟥 execution_time [+308.101ms; +314.580ms] or [+156.823%; +160.120%]

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

  • 🟥 execution_time [+300.407ms; +305.232ms] or [+150.391%; +152.806%]

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

  • unstable execution_time [-64.863ms; -34.472ms] or [-32.421%; -17.230%]
  • unstable throughput [-196135.960op/s; -112104.631op/s] or [-37.124%; -21.219%]

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

  • unstable execution_time [-92.946ms; -71.628ms] or [-47.114%; -36.308%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.370ms; +317.369ms] or [+151.203%; +158.180%]

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

  • unstable execution_time [+226.149ms; +283.032ms] or [+113.561%; +142.125%]

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

  • 🟥 execution_time [+304.225ms; +310.163ms] or [+154.284%; +157.295%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.263ms; +301.341ms] or [+149.773%; +150.311%]
  • 🟩 throughput [+64731529.837op/s; +65040088.308op/s] or [+47.142%; +47.366%]

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

  • unstable execution_time [+378.798ms; +408.957ms] or [+471.102%; +508.610%]
  • 🟥 throughput [-7619.833op/s; -7288.384op/s] or [-58.905%; -56.343%]

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

  • 🟥 execution_time [+297.320ms; +299.173ms] or [+148.296%; +149.221%]
  • 🟥 throughput [-17871417.069op/s; -16716532.185op/s] or [-7.916%; -7.404%]

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

  • unstable execution_time [-78.039ms; -53.188ms] or [-38.222%; -26.051%]
  • unstable throughput [-200870.960op/s; -51670.262op/s] or [-18.755%; -4.824%]

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

  • unstable execution_time [-75.288ms; -49.112ms] or [-38.096%; -24.851%]

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

  • unstable execution_time [-25.739ms; -2.653ms] or [-13.410%; -1.382%]
  • unstable throughput [-498060.157op/s; -338486.028op/s] or [-38.551%; -26.199%]

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

  • unstable execution_time [-56.937ms; -29.376ms] or [-27.974%; -14.433%]
  • 🟩 throughput [+76874.568op/s; +93687.317op/s] or [+7.635%; +9.305%]

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

  • unstable execution_time [-39.342ms; -0.516ms] or [-19.647%; -0.258%]
  • unstable throughput [-199869.452op/s; -107359.436op/s] or [-36.293%; -19.495%]

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

  • unstable execution_time [-89.621ms; -66.858ms] or [-45.029%; -33.592%]

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

  • unstable execution_time [-75.399ms; -36.363ms] or [-37.713%; -18.188%]
  • unstable throughput [-129683.539op/s; +387.334op/s] or [-14.489%; +0.043%]

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

  • unstable execution_time [-54.015ms; -25.094ms] or [-27.433%; -12.745%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • 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.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/otlp-traces-protobuf branch from 2f1cb24 to eedee80 Compare May 15, 2026 01:41
@zacharycmontoya zacharycmontoya changed the title Zach.montoya/otlp traces protobuf [Tracing] Add experimental http/protobuf support for OTLP traces export May 15, 2026
@zacharycmontoya zacharycmontoya added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:opentelemetry OpenTelemetry support labels May 15, 2026
@zacharycmontoya zacharycmontoya marked this pull request as ready for review May 15, 2026 20:11
@zacharycmontoya zacharycmontoya requested review from a team as code owners May 15, 2026 20:11
@zacharycmontoya zacharycmontoya requested a review from a team as a code owner May 15, 2026 20:11
@zacharycmontoya zacharycmontoya requested a review from vandonr May 15, 2026 20:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a3f4eb162

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs Outdated
- Revert order of OtlpProtocol switch cases
- Add comment to OtlpTracesProtobufSerializer to describe why we're manually serializing OTLP traces

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, mostly just some nits/questsions/suggestions

Comment thread tracer/src/Datadog.Trace/Agent/ApiOtlp.cs
Comment thread tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
Comment thread tracer/test/Datadog.Trace.Tests/OpenTelemetry/Traces/OtlpProtoParser.cs Outdated
- Remove grpc and let it fall into the general error fallback case
- Update the OtlpTracesProtobufSerializerTests to use the real protobuf definitions and produce generated C# files from the Grpc.Tools library
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-dotnet | check-big-regressions   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Execution of Regression Check failed with exit code 5 during job execution.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a1da8e6 | Docs | Datadog PR Page | Give us feedback!

- Remove unnecessary ! (null-forgiving) operators
- Refactor the serialization of Span.Status to slightly improve perf
- Add bounds checking to the OtlpTracesProtobufSerializer
…rary buffer size rather than increase the capacity all at once.
@zacharycmontoya

Copy link
Copy Markdown
Contributor Author

@andrewlock and @vandonr I've addressed most feedback but I have two small follow-up items then I plan to merge. If you're still invested in the small suggestions, I'd appreciate if you could review my latest changes while I follow-up on the remaining feedback.

Remaining feedback I'll be addressing:

  • The Datadog.Trace.Tests unit tests are failing to build in CI due to protoc compilation where we validate our OTLP protobuf messages against an official protobuf parser
  • We can write KeyValueAttributes where the value could be of multiple primitive types. I need to follow up on the allowed primitive types and ensure it's encoding the values as desired

…and it will allow us to unit test the OTLP protobuf serializer
…s more in-code documentation for WriteAnyValue and implements identical logic to the OpenTelemetry .NET protobuf serializer in terms of handling primitive types.

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM overall, thanks! Just one small question about failing to increase buffer size, and one incorrect comment. Though I think integration tests are currently failing


return bytesWritten;
}
catch (Exception ex) when (ex is IndexOutOfRangeException or ArgumentException)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's interesting, because it looks like there's two "failure" modes:

  • TemporaryBuffer was resized to > maxSize, but otherwise we completed sucessfully
  • Serializer just tried to overwrite the end, and threw.

Just seems strange that we can fail in those two different ways? 🤔 Why do the second one when the first one is an option 🤷‍♂️ Anyway, just pondering, I realize it's just the behaviour of the serializer! 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reasoning about this, the catch block below will catch when we hit the following issue:

  • Serializer just tried to overwrite the end, and threw.

When we hit that, we resize the buffer to Math.Min(currentBufferSize * 2, maxSize). Then at that point our buffer should always throw if we exceed maxSize. But as a backup, we manually check the condition with if (bytesWritten > maxSize). So the first case is more of a backup that we haven't written more than what can be transferred once we hand control back to the SpanBuffer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a more clear Math.Min(currentBufferSize * 2, maxSize) in c132645. Hope the explanation here helps too

// range); the catch below treats that as overflow and returns 0.
// TODO: Follow the OpenTelemetry SDK approach to grow the buffer only as necessary.
MessagePackBinary.EnsureCapacity(ref bytes, temporaryBufferOffset, maxSize);
// Initialize the temporary buffer to the initial size deemed best by the OpenTelemetry .NET SDK

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😂 "Not my fault, mate, it was like that when I got here, go ask the OTel team"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In general there seems to be more bytes for OTLP payloads because there's more structure and more instrumentation scopes (spans grouped by the library that produced them), so I think it benefits us to start at a higher initial buffer size 😄

Comment thread tracer/src/Datadog.Trace/OpenTelemetry/Traces/OtlpTracesProtobufSerializer.cs Outdated
…Serializer.SerializeSpans to clarify curious behaviors
…it with proper serialization of array attributes (currently only on events). Also updated the http/json serializer to produce array attributes rather than a simple array.ToString()
@zacharycmontoya zacharycmontoya merged commit 35f65d0 into master May 22, 2026
138 checks passed
@zacharycmontoya zacharycmontoya deleted the zach.montoya/otlp-traces-protobuf branch May 22, 2026 20:01
@github-actions github-actions Bot added this to the vNext-v3 milestone May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:opentelemetry OpenTelemetry support area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants