Skip to content

feat(otel): Emit OpenTelemetry HTTP semantic convention on HTTP client spans - #8975

Open
zacharycmontoya wants to merge 9 commits into
refactor-otlp-testingfrom
otel-httpclient
Open

feat(otel): Emit OpenTelemetry HTTP semantic convention on HTTP client spans#8975
zacharycmontoya wants to merge 9 commits into
refactor-otlp-testingfrom
otel-httpclient

Conversation

@zacharycmontoya

Copy link
Copy Markdown
Contributor

Summary of changes

Updates the HTTP client spans produced by our automatic instrumentation so that their span name and request attributes match the OpenTelemetry HTTP client span specification when DD_TRACE_OTEL_SEMANTICS_ENABLED=true. Also forces the metadata schema version to v0 whenever OpenTelemetry semantics are enabled, so that v1-only Datadog attributes can no longer be layered on top of OpenTelemetry attributes.

Reason for change

When DD_TRACE_OTEL_SEMANTICS_ENABLED=true, the SDK should produce spans that align with the OpenTelemetry semantic conventions. Today an HTTP client span emits the Datadog attribute set (http.method, http.url, out.host) and a Datadog resource name (GET localhost:8080/api/users). After the changes, a user who has opted into OpenTelemetry semantics (and OTLP traces) will be able to switch freely between OpenTelemetry and Datadog instrumentations without needing to modify OpenTelemetry-based dashboards, monitors, or downstream tooling for their HTTP client spans.

Implementation details

Configuration

This is enabled by the recently introduced DD_TRACE_OTEL_SEMANTICS_ENABLED=true configuration.

This also now overrides TracerSettings.MetadataSchemaVersion by setting hard-coding it to V0, logging a warning and recording the calculated value in telemetry with ConfigurationOrigins.Calculated. This decision may be updated through additional peer service discussions in the Datadog RFC.

One narrow case is intentionally left alone (possibly to be addressed in a follow-up): explicitly setting DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED=true still selects HttpV1Tags, since that is an independent knob, so peer.service can still appear alongside OpenTelemetry attributes in that opt-in configuration.

ITags changes

HttpTags now carries first-class properties to carry OpenTelemetry concepts, in addition to Datadog concepts. When a property is represented in both Datadog and OpenTelemetry semantics, the corresponding tag name is emitted based on Span.OpenTelemetrySemanticsEnabled:

Property Datadog semantics OpenTelemetry semantics
HttpMethod http.method http.request.method
HttpUrl http.url url.full
Host out.host server.address
HttpStatusCode http.status_code http.response.status_code
HttpRequestMethodOriginal (not emitted) http.request.method_original
ServerPort (not emitted) server.port

HttpRequestMethodOriginal and ServerPort are OpenTelemetry-only concepts, so they have no Datadog name and are only ever populated when OpenTelemetry semantics are enabled. HttpStatusCode and ServerPort are backed by an int? and serialized as integer attributes over OTLP.

HttpSemanticConventions

Adds a single HttpSemanticConventions.SetHttpClientRequestValues(span, tags, httpMethod, requestUri, queryStringManager) entry point that owns all of the logic for producing an HTTP client span that aligns with the OpenTelemetry semantic conventions, so that individual integrations only need to supply the corresponding data from their request object. The logic can be summarized in the following way:

  • http.request.method is normalized to its canonical (uppercase) form. The known set is the RFC 9110 methods plus PATCH and QUERY. Any unrecognized method is reported as _OTHER.
  • http.request.method_original is only set when the value supplied by the instrumented library differs (case-sensitively) from http.request.method. It is always assigned, including to null, so that the last update wins because some integrations call into this method more than once for the same span.
  • The span name is the request method alone (HTTP when the method is _OTHER). The spec's {method} {target} form needs a low-cardinality target, and we do not have one for client spans until we support url.template — notably, the spec forbids falling back to the URI path, so the Datadog GET localhost:8080/api/users resource name is not reused here.
  • server.port comes from Uri.Port, which is the scheme's default port when the URL does not specify one. The spec requires this span attribute to be reported.

url.full credential redaction

url.full is the OpenTelemetry equivalent of http.url, which means it reports an absolute URL with redaction/obfuscation.

This PR adds HttpRequestUtils.GetUrlFull() to produce the same value as GetUrl(), except that it also handles credentials supplied in the URL by redacting them rather than dropping them, as the spec requires: http://user:pass@localhost/path becomes http://REDACTED:REDACTED@localhost/path, and a username with no password becomes http://REDACTED@localhost/path rather than inventing a password. Query-string truncation and obfuscation still run through QueryStringManager as before.

Two deviations from the spec are known, and are pinned by [InlineData] rows in HttpRequestUtilsTests so that they are recorded rather than mistaken for compliance:

  1. Query scrubbing uses DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP, which replaces the whole match with <redacted> instead of preserving the key (sig=REDACTED), and whose default pattern does not match sig or X-Amz-Credential at all. That part of the spec is Development stability and explicitly allows the default key list to be overridden, which is effectively what our regex does.
  2. A known URI fragment is dropped, whereas the spec says it SHOULD be included when known.

Integration call sites

SetHttpClientRequestValues is called from:

  • ScopeFactory.CreateInactiveOutboundHttpSpan, which covers every outbound HTTP integration that goes through ScopeFactory (HttpMessageHandler, WebRequest, WebClient). The existing Datadog path is preserved in the else branch of if (span.OpenTelemetrySemanticsEnabled).
  • The Remoting client integration HttpProcessAndSendIntegration, which builds its tags separately from ScopeFactory.

Test coverage

Unit tests

  • HttpSemanticConventionsTests — Exercises every known HTTP method in canonical and lower-case form and unrecognized methods, ensuring the the reported HTTP method and span name are calculated.
  • ScopeFactoryTests — Asserts the full serialized tag set for an outbound HTTP span with either Datadog semantics or OpenTelemetry semantics, including method normalization, default-port behaviour, and URL credential redaction.
  • TagsListTests — New tests assert that each aliased pair enumerates exactly one name per concept, that either name can be used with GetTag/SetTag, and that server.port is omitted when unset (though our integrations must always set it).
  • HttpRequestUtilsTests — Asserts GetUrlFull redaction, query obfuscation interaction, and the two spec deviations noted above.
  • TracerSettingsTests — Tests the overriding of the metadata schema version to v0 when OpenTelemetry semantics are enabled, and unchanged when not using OpenTelemetry semantics.

Integration tests

  • SpanMetadataOTelRules - Adds span assertions for OpenTelemetry HTTP client spans in IsHttpClientRequestOTel
  • WebRequestTests.SubmitsTracesV0WithOpenTelemetrySemantics / SubmitsTracesV1WithOpenTelemetrySemantics — the existing msgpack snapshot test parameterized on the new flag. Both cases share the new WebRequestTests_otel.verified.txt snapshot, because OpenTelemetry semantics force v0 regardless of the requested schema. Span validation runs through the new SpanMetadataOTelRules.IsHttpClientRequestOTel rule set, which encodes the spec's required / conditionally-required / recommended attributes for a client span.
  • WebRequestTests.SubmitsOtlpTraces — a new [SkippableTheory] that performs snapshot testing of the application, testing OTLP JSON / OTLP protobuf with OTel semantics off/on. This uses the ddapm test-agent much like OpenTelemetrySdkTests. Two snapshot files are created: one per semantics setting.
  • TestAgentOtlpCollection — a shared xUnit collection with DisableParallelization = true, applied to both WebRequestTests and OpenTelemetrySdkTests. POST /test/session/clear wipes the test-agent session globally, so two classes reading OTLP from it must not run concurrently. OpenTelemetrySdkTests was previously safe only because all of its OTLP tests happened to share one implicit per-class collection; adding OTLP tests to a second class breaks that. WebRequestTests' own single-class CollectionDefinition is replaced by the shared one, which also disables parallelization.
    • Note: We should be able to create a random session header that is sent by the test and the instrumented application (set by OTEL_EXPORTER_OTLP_HEADERS) so we can get/clear data on a per-session basis, but this hasn't been tested yet.

Other details

Follow-up work

  1. error.type is not set for HTTP client transport failures (DNS, connection refused, TLS, timeout). Under OpenTelemetry semantics Span.SetException only records an exception span event, and the spec wants the fully-qualified exception type in a span-level error.type.
  2. url.template is not supported, which would provide the {target} placeholder in OpenTelemetry the spec's {method} {target} span name format.
  3. The recommended network attributes are still unset: network.protocol.name, network.protocol.version, network.peer.address, network.peer.port, and http.request.resend_count.
  4. The two url.full deviations above (query-key preservation and the dropped fragment).
  5. Server-side (ASP.NET / ASP.NET Core) and Inferred Proxy spans are separate work. Because HttpStatusCode already carries an OtelName on WebTags, InferredProxyTags, and AwsSdkTags, those span types currently emit a mixed http.response.status_code + http.method + http.url attribute set until their own PRs land.

zacharycmontoya and others added 9 commits July 31, 2026 13:54
- Add "http.response.status_code" and "url.full" as the OTel Name for the HttpTags first-class HttpMethod and Host properties
- Introduce HttpRequestMethodOriginal and ServerPort properties on HttpTags to set OpenTelemetry span attributes "http.request.method_original" and "server.port"
- Add one central `HttpSemanticConventions.SetHttpClientRequestValues `method that updtes a span and its HttpTags object with all of the logic for required and some recommended span attributes
- Call the above `HttpSemanticConventions.SetHttpClientRequestValues` from `ScopeFactory.CreateInactiveOutboundHttpSpan` and the remoting client `HttpProcessAndSendIntegration`
…th DD_TRACE_OTEL_SEMANTICS_ENABLED emitting DD MsgPack
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zacharycmontoya zacharycmontoya added the area:opentelemetry OpenTelemetry support label Jul 31, 2026
@zacharycmontoya
zacharycmontoya requested review from a team as code owners July 31, 2026 22:47
@zacharycmontoya
zacharycmontoya requested review from vandonr and removed request for a team July 31, 2026 22:47

@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: b3da552364

ℹ️ 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 on lines +40 to +41
private static readonly Dictionary<string, string> CanonicalRequestMethods =
new(StringComparer.OrdinalIgnoreCase)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the configured HTTP known-method list

When a user sets the standard OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS option—for example, to recognize PROPFIND—this hard-coded dictionary still classifies that method as _OTHER and names the span HTTP. The OpenTelemetry HTTP semantic conventions define this setting specifically so instrumentations can extend the recognized-method list; parse it through the repository's supported configuration system and include its values during normalization.

AGENTS.md reference: AGENTS.md:L284-L288

Useful? React with 👍 / 👎.

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.

Seems like a reasonable ask, but could also consider it out of scope? Should probably be something mentioned on the RFC either way?

Comment on lines +73 to +76
tags.HttpRequestMethodOriginal =
!StringUtil.IsNullOrEmpty(httpMethod) && !string.Equals(httpMethod, requestMethod, StringComparison.Ordinal)
? httpMethod
: null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit method_original only when the normalized method is _OTHER

For a recognized method supplied with noncanonical casing, such as get, this assigns http.request.method_original=get even though http.request.method is normalized to GET. Under the OpenTelemetry HTTP convention, http.request.method_original is conditionally required only when the normalized method is _OTHER; emitting it for recognized methods produces an attribute shape that differs from conforming OpenTelemetry instrumentation.

Useful? React with 👍 / 👎.

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.

Easy to change the comparison if we need to, not sure which way we need to go

if (requestUri is not null)
{
tags.HttpUrl = HttpRequestUtils.GetUrlFull(requestUri, queryStringManager);
tags.Host = HttpRequestUtils.GetNormalizedHost(requestUri.Host);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip URI brackets from IPv6 server addresses

For an IPv6 request such as http://[::1]:8080/, Uri.Host returns [::1], so this emits the bracketed URI-host syntax as server.address. OpenTelemetry expects the address value itself (for example, ::1); retaining brackets makes IPv6 peers group under a noncanonical address and prevents parity with conforming instrumentation, while the brackets should remain only in url.full.

Useful? React with 👍 / 👎.

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.

man I hate IPv6


// Uri.Port is the default port for the scheme when the URL doesn't specify one,
// which is what we want to report in "server.port"
tags.ServerPort = requestUri.Port;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Omit server.port when the URI has no port

For an absolute URI whose scheme has no registered default port, such as one handled by a custom HttpMessageHandler using http+unix://socket/path, Uri.Port returns -1. This assignment consequently serializes server.port=-1, which is not a valid server port; only populate the attribute when the URI exposes a valid port.

Useful? React with 👍 / 👎.

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8975) 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
duration71.83 ± (71.79 - 72.13) ms74.68 ± (74.25 - 74.80) ms+4.0%✅⬆️
.NET Framework 4.8 - Bailout
duration80.27 ± (80.46 - 81.58) ms78.11 ± (77.76 - 78.36) ms-2.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1094.89 ± (1093.39 - 1099.55) ms1087.10 ± (1086.87 - 1092.19) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.40 ± (22.35 - 22.45) ms22.43 ± (22.38 - 22.48) ms+0.2%✅⬆️
process.time_to_main_ms84.76 ± (84.47 - 85.06) ms85.27 ± (84.95 - 85.59) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.03 ± (11.03 - 11.04) MB11.00 ± (11.00 - 11.00) MB-0.3%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.33 ± (22.29 - 22.37) ms21.97 ± (21.95 - 22.00) ms-1.6%
process.time_to_main_ms85.28 ± (85.01 - 85.56) ms82.86 ± (82.68 - 83.04) ms-2.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.06 ± (11.06 - 11.07) MB11.03 ± (11.02 - 11.03) MB-0.3%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms210.28 ± (209.34 - 211.21) ms210.02 ± (209.24 - 210.79) ms-0.1%
process.time_to_main_ms538.93 ± (537.63 - 540.23) ms539.82 ± (538.63 - 541.00) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.64 ± (49.60 - 49.67) MB49.63 ± (49.60 - 49.66) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.25 ± (21.20 - 21.30) ms20.79 ± (20.76 - 20.83) ms-2.1%
process.time_to_main_ms74.78 ± (74.49 - 75.07) ms70.96 ± (70.83 - 71.10) ms-5.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.73) MB10.74 ± (10.73 - 10.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.82 ± (20.79 - 20.86) ms21.06 ± (21.02 - 21.11) ms+1.1%✅⬆️
process.time_to_main_ms72.52 ± (72.35 - 72.69) ms74.72 ± (74.47 - 74.97) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.83 ± (10.83 - 10.84) MB10.85 ± (10.85 - 10.85) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms371.98 ± (369.86 - 374.09) ms370.53 ± (368.51 - 372.55) ms-0.4%
process.time_to_main_ms546.78 ± (545.59 - 547.96) ms542.90 ± (541.76 - 544.05) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.65 ± (50.63 - 50.68) MB50.69 ± (50.67 - 50.71) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms19.21 ± (19.17 - 19.25) ms19.15 ± (19.11 - 19.19) ms-0.3%
process.time_to_main_ms71.47 ± (71.20 - 71.74) ms70.93 ± (70.70 - 71.16) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.76 ± (7.76 - 7.76) MB7.76 ± (7.75 - 7.76) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.44 ± (19.40 - 19.49) ms19.07 ± (19.03 - 19.10) ms-1.9%
process.time_to_main_ms74.88 ± (74.62 - 75.13) ms71.53 ± (71.41 - 71.65) ms-4.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.83 ± (7.82 - 7.84) MB7.82 ± (7.81 - 7.83) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms296.66 ± (294.51 - 298.81) ms300.82 ± (298.60 - 303.05) ms+1.4%✅⬆️
process.time_to_main_ms492.46 ± (491.49 - 493.44) ms494.27 ± (493.34 - 495.20) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.07 ± (38.04 - 38.10) MB38.17 ± (38.15 - 38.20) MB+0.3%✅⬆️
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
duration210.98 ± (210.61 - 211.56) ms191.86 ± (191.53 - 192.32) ms-9.1%
.NET Framework 4.8 - Bailout
duration214.99 ± (214.44 - 215.34) ms195.20 ± (195.04 - 195.39) ms-9.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1265.27 ± (1264.17 - 1271.43) ms1172.68 ± (1173.35 - 1179.84) ms-7.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms203.57 ± (203.12 - 204.02) ms184.54 ± (184.31 - 184.76) ms-9.3%
process.time_to_main_ms89.89 ± (89.58 - 90.20) ms80.45 ± (80.25 - 80.64) ms-10.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.05 - 16.09) MB16.28 ± (16.26 - 16.31) MB+1.4%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-1.4%
.NET Core 3.1 - Bailout
process.internal_duration_ms202.98 ± (202.52 - 203.44) ms183.39 ± (183.16 - 183.61) ms-9.7%
process.time_to_main_ms91.51 ± (91.27 - 91.76) ms81.60 ± (81.52 - 81.68) ms-10.8%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.06 - 16.09) MB16.36 ± (16.31 - 16.41) MB+1.8%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.7%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms401.33 ± (399.93 - 402.73) ms375.61 ± (374.37 - 376.85) ms-6.4%
process.time_to_main_ms566.20 ± (565.03 - 567.37) ms523.06 ± (522.22 - 523.89) ms-7.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.80 ± (59.70 - 59.91) MB58.07 ± (58.00 - 58.15) MB-2.9%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-1.2%
.NET 6 - Baseline
process.internal_duration_ms208.47 ± (208.06 - 208.87) ms188.26 ± (188.02 - 188.50) ms-9.7%
process.time_to_main_ms78.92 ± (78.61 - 79.23) ms70.47 ± (70.32 - 70.61) ms-10.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.46 ± (16.44 - 16.48) MB15.61 ± (15.43 - 15.79) MB-5.2%
runtime.dotnet.threads.count20 ± (19 - 20)17 ± (17 - 18)-10.6%
.NET 6 - Bailout
process.internal_duration_ms207.40 ± (206.88 - 207.93) ms187.54 ± (187.38 - 187.69) ms-9.6%
process.time_to_main_ms79.58 ± (79.36 - 79.80) ms71.51 ± (71.45 - 71.57) ms-10.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.48 ± (16.46 - 16.50) MB15.72 ± (15.55 - 15.89) MB-4.6%
runtime.dotnet.threads.count21 ± (20 - 21)18 ± (18 - 19)-10.2%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms579.91 ± (577.66 - 582.17) ms580.06 ± (577.14 - 582.97) ms+0.0%✅⬆️
process.time_to_main_ms579.70 ± (578.49 - 580.91) ms536.93 ± (536.00 - 537.86) ms-7.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.61 ± (61.53 - 61.69) MB61.75 ± (61.69 - 61.81) MB+0.2%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.1%
.NET 8 - Baseline
process.internal_duration_ms209.30 ± (208.84 - 209.75) ms186.72 ± (186.48 - 186.96) ms-10.8%
process.time_to_main_ms78.75 ± (78.48 - 79.01) ms69.82 ± (69.68 - 69.95) ms-11.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.76 - 11.80) MB11.94 ± (11.88 - 11.99) MB+1.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 18)-5.2%
.NET 8 - Bailout
process.internal_duration_ms209.21 ± (208.71 - 209.70) ms185.91 ± (185.76 - 186.06) ms-11.1%
process.time_to_main_ms80.08 ± (79.86 - 80.29) ms70.90 ± (70.83 - 70.96) ms-11.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.83 ± (11.81 - 11.85) MB11.87 ± (11.79 - 11.96) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (18 - 19)-7.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms517.32 ± (511.82 - 522.81) ms510.17 ± (507.26 - 513.08) ms-1.4%
process.time_to_main_ms531.98 ± (531.07 - 532.89) ms484.95 ± (484.33 - 485.56) ms-8.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.36 ± (51.31 - 51.41) MB51.49 ± (51.46 - 51.52) MB+0.3%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)29 ± (29 - 29)-2.6%
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 (8975) - mean (75ms)  : 71, 79
    master - mean (72ms)  : 69, 75

    section Bailout
    This PR (8975) - mean (78ms)  : 73, 83
    master - mean (81ms)  : 73, 89

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (1,090ms)  : 1052, 1127
    master - mean (1,096ms)  : 1052, 1141

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 (8975) - mean (115ms)  : 109, 121
    master - mean (115ms)  : 108, 121

    section Bailout
    This PR (8975) - mean (112ms)  : 108, 115
    master - mean (115ms)  : 108, 122

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (787ms)  : 763, 811
    master - mean (785ms)  : 763, 807

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8975) - mean (98ms)  : 95, 100
    master - mean (103ms)  : 97, 109

    section Bailout
    This PR (8975) - mean (103ms)  : 97, 109
    master - mean (99ms)  : 96, 103

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (942ms)  : 903, 982
    master - mean (950ms)  : 901, 999

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8975) - mean (97ms)  : 92, 103
    master - mean (98ms)  : 92, 105

    section Bailout
    This PR (8975) - mean (97ms)  : 96, 99
    master - mean (102ms)  : 96, 108

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (824ms)  : 784, 864
    master - mean (822ms)  : 782, 862

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 (8975) - mean (192ms)  : 188, 196
    master - mean (211ms)  : 205, 217

    section Bailout
    This PR (8975) - mean (195ms)  : 193, 197
    master - mean (215ms)  : 211, 219

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (1,177ms)  : 1130, 1223
    master - mean (1,268ms)  : 1214, 1321

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 (8975) - mean (274ms)  : 269, 279
    master - mean (303ms)  : 294, 312

    section Bailout
    This PR (8975) - mean (274ms)  : 271, 276
    master - mean (305ms)  : 295, 315

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (939ms)  : 915, 962
    master - mean (1,009ms)  : 984, 1035

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8975) - mean (268ms)  : 264, 271
    master - mean (298ms)  : 291, 305

    section Bailout
    This PR (8975) - mean (268ms)  : 265, 270
    master - mean (297ms)  : 291, 303

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (1,143ms)  : 1084, 1202
    master - mean (1,200ms)  : 1160, 1239

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8975) - mean (266ms)  : 262, 269
    master - mean (300ms)  : 294, 306

    section Bailout
    This PR (8975) - mean (266ms)  : 263, 269
    master - mean (301ms)  : 293, 308

    section CallTarget+Inlining+NGEN
    This PR (8975) - mean (1,029ms)  : 984, 1073
    master - mean (1,094ms)  : 989, 1199

Loading

@pr-commenter

pr-commenter Bot commented Jul 31, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-31 23:34:07

Comparing candidate commit b3da552 in PR branch otel-httpclient with baseline commit 1dbaad3 in branch master.

📊 Benchmarking dashboard

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

Explanation

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

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

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

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

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

More details about the CI and significant changes

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

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

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

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

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

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

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-26036.783op/s; -23010.328op/s] or [-7.333%; -6.481%]

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.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-8469.017op/s; -8050.328op/s] or [-10.042%; -9.545%]

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

  • 🟥 throughput [-12430.292op/s; -10858.171op/s] or [-12.639%; -11.040%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+308.485ms; +315.500ms] or [+153.081%; +156.562%]
  • 🟥 throughput [-47.088op/s; -42.644op/s] or [-8.472%; -7.673%]

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

  • 🟥 execution_time [+376.607ms; +378.576ms] or [+297.542%; +299.098%]
  • 🟩 throughput [+96.765op/s; +100.129op/s] or [+12.758%; +13.202%]

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

  • 🟥 execution_time [+391.554ms; +394.705ms] or [+346.510%; +349.299%]

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

  • 🟥 allocated_mem [+4.693KB; +4.694KB] or [+98.806%; +98.821%]
  • 🟥 throughput [-60651.268op/s; -60289.975op/s] or [-47.190%; -46.909%]

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

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-16.142ms; -11.970ms] or [-7.539%; -5.590%]
  • 🟥 throughput [-58887.726op/s; -56128.765op/s] or [-42.985%; -40.971%]

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

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-48522.941op/s; -46275.532op/s] or [-43.870%; -41.838%]

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

  • 🟥 allocated_mem [+1.315KB; +1.315KB] or [+106.388%; +106.404%]
  • 🟥 throughput [-253186.350op/s; -248371.853op/s] or [-25.852%; -25.360%]

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

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-26.296ms; -21.447ms] or [-11.727%; -9.564%]
  • 🟥 throughput [-72588.777op/s; -48880.978op/s] or [-7.755%; -5.222%]

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

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-157559.539op/s; -141399.389op/s] or [-22.638%; -20.316%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72832.762op/s; -72057.361op/s] or [-49.016%; -48.494%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-73722.099op/s; -70836.512op/s] or [-46.908%; -45.072%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56379.110op/s; -53760.360op/s] or [-44.913%; -42.827%]

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

  • 🟩 throughput [+315031.766op/s; +336186.806op/s] or [+10.505%; +11.210%]

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

  • 🟩 execution_time [-18.762ms; -14.323ms] or [-8.648%; -6.603%]

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

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+299.927ms; +300.467ms] or [+149.863%; +150.133%]
  • 🟩 throughput [+1016.451op/s; +1035.167op/s] or [+11.227%; +11.433%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+297.537ms; +311.776ms] or [+150.049%; +157.229%]
  • 🟩 throughput [+2204.184op/s; +2585.835op/s] or [+16.859%; +19.778%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.524ms; +302.915ms] or [+151.381%; +152.585%]
  • 🟩 throughput [+1790.376op/s; +1917.385op/s] or [+17.285%; +18.511%]

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

  • 🟥 execution_time [+297.065ms; +297.887ms] or [+145.906%; +146.310%]
  • 🟩 throughput [+582.398op/s; +596.961op/s] or [+15.440%; +15.826%]

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

  • 🟥 execution_time [+295.042ms; +300.392ms] or [+144.235%; +146.850%]
  • 🟩 throughput [+2742.089op/s; +2798.425op/s] or [+39.837%; +40.656%]

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

  • 🟥 execution_time [+300.047ms; +301.734ms] or [+149.963%; +150.806%]
  • 🟩 throughput [+1404.297op/s; +1422.834op/s] or [+27.874%; +28.242%]

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

  • 🟩 execution_time [-148.960µs; -144.392µs] or [-30.584%; -29.646%]
  • 🟩 throughput [+869.529op/s; +901.813op/s] or [+42.350%; +43.922%]

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

  • 🟩 execution_time [-138.293µs; -111.553µs] or [-31.718%; -25.585%]
  • 🟩 throughput [+853.589op/s; +977.415op/s] or [+37.111%; +42.494%]

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

  • 🟩 execution_time [-142.515µs; -120.521µs] or [-30.534%; -25.822%]
  • 🟩 throughput [+775.863op/s; +858.670op/s] or [+35.815%; +39.638%]

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

  • 🟩 execution_time [-129.301µs; -125.055µs] or [-34.910%; -33.764%]
  • 🟩 throughput [+1388.155op/s; +1438.279op/s] or [+51.411%; +53.267%]

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

  • 🟩 execution_time [-102.386µs; -78.820µs] or [-32.687%; -25.163%]
  • 🟩 throughput [+1184.340op/s; +1384.671op/s] or [+36.919%; +43.164%]

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

  • 🟩 execution_time [-138.539µs; -116.113µs] or [-37.899%; -31.764%]
  • 🟩 throughput [+1343.020op/s; +1481.706op/s] or [+48.196%; +53.173%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.974ms; +300.679ms] or [+149.718%; +150.070%]

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

  • 🟥 execution_time [+405.364ms; +410.634ms] or [+440.444%; +446.171%]
  • 🟩 throughput [+756.241op/s; +904.329op/s] or [+6.214%; +7.431%]

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

  • unstable execution_time [+297.407ms; +348.677ms] or [+225.819%; +264.747%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+2.848KB; +2.853KB] or [+5.060%; +5.069%]
  • unstable execution_time [+352.490ms; +402.125ms] or [+162.072%; +184.893%]
  • 🟥 throughput [-528.272op/s; -483.989op/s] or [-47.867%; -43.854%]

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

  • unstable execution_time [+200.987ms; +334.269ms] or [+85.652%; +142.451%]
  • 🟥 throughput [-668.139op/s; -584.732op/s] or [-44.565%; -39.002%]

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

  • 🟥 execution_time [+326.972ms; +334.992ms] or [+195.567%; +200.364%]
  • 🟥 throughput [-420.967op/s; -381.494op/s] or [-29.311%; -26.563%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1

  • unstable throughput [+14.131op/s; +51.565op/s] or [+4.062%; +14.822%]

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

  • 🟩 execution_time [-78.998µs; -57.240µs] or [-7.327%; -5.309%]
  • 🟩 throughput [+51.791op/s; +76.549op/s] or [+5.584%; +8.254%]

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

  • 🟩 execution_time [-194.085µs; -145.824µs] or [-9.832%; -7.387%]
  • 🟩 throughput [+42.329op/s; +55.313op/s] or [+8.356%; +10.919%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.767ms; +303.887ms] or [+151.964%; +153.031%]

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

  • 🟥 execution_time [+300.441ms; +310.138ms] or [+150.551%; +155.411%]

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

  • 🟥 execution_time [+299.307ms; +302.465ms] or [+150.359%; +151.945%]
  • 🟩 throughput [+24152.058op/s; +31711.446op/s] or [+5.088%; +6.680%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.034ms; +306.760ms] or [+151.672%; +154.044%]

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

  • 🟥 execution_time [+297.289ms; +299.586ms] or [+146.996%; +148.132%]

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

  • 🟥 execution_time [+303.906ms; +308.238ms] or [+154.033%; +156.228%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+300.620ms; +301.948ms] or [+150.884%; +151.551%]

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

  • 🟥 execution_time [+296.680ms; +308.006ms] or [+147.868%; +153.513%]
  • 🟩 throughput [+46178.412op/s; +57497.620op/s] or [+9.170%; +11.417%]

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

  • 🟥 execution_time [+298.819ms; +301.274ms] or [+148.660%; +149.881%]

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

  • 🟩 execution_time [-15.899ms; -12.181ms] or [-7.393%; -5.664%]
  • 🟩 throughput [+20863.455op/s; +27841.121op/s] or [+5.723%; +7.638%]

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

  • unstable execution_time [+17.937µs; +60.921µs] or [+4.431%; +15.048%]

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

  • 🟩 allocated_mem [-20.840KB; -20.816KB] or [-7.602%; -7.593%]
  • unstable execution_time [-45.293µs; +9.864µs] or [-8.952%; +1.950%]

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

  • 🟥 allocated_mem [+60.745KB; +60.766KB] or [+22.144%; +22.152%]
  • unstable execution_time [+54.364µs; +275.143µs] or [+9.421%; +47.680%]
  • unstable throughput [-306.789op/s; -0.964op/s] or [-17.527%; -0.055%]

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

  • unstable execution_time [+7.139µs; +13.340µs] or [+16.875%; +31.531%]
  • 🟥 throughput [-5366.820op/s; -3226.377op/s] or [-22.593%; -13.582%]

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

  • unstable execution_time [-14.806µs; -6.388µs] or [-22.971%; -9.910%]
  • unstable throughput [+1767.609op/s; +3513.571op/s] or [+10.845%; +21.557%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.205ms; +303.636ms] or [+152.751%; +153.475%]

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

  • 🟥 execution_time [+301.993ms; +304.409ms] or [+153.714%; +154.943%]

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

  • 🟥 execution_time [+297.470ms; +299.660ms] or [+148.920%; +150.017%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.882ms; +301.949ms] or [+149.464%; +150.494%]

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

  • 🟥 execution_time [+301.169ms; +302.993ms] or [+151.233%; +152.149%]

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

  • 🟥 execution_time [+306.080ms; +309.524ms] or [+155.224%; +156.971%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.474ms; +300.477ms] or [+149.379%; +149.880%]
  • 🟩 throughput [+60669997.925op/s; +60973633.796op/s] or [+44.184%; +44.405%]

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

  • 🟥 execution_time [+419.071ms; +423.227ms] or [+521.189%; +526.358%]

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

  • 🟥 execution_time [+299.691ms; +300.707ms] or [+149.479%; +149.986%]

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

  • 🟩 throughput [+55007.245op/s; +68006.286op/s] or [+5.136%; +6.350%]

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

  • 🟩 throughput [+78673.094op/s; +107817.262op/s] or [+6.089%; +8.345%]

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

  • 🟩 throughput [+51631.934op/s; +59858.785op/s] or [+5.128%; +5.945%]

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

  • 🟩 throughput [+50847.044op/s; +57278.314op/s] or [+9.233%; +10.401%]

Known flaky benchmarks without significant changes:

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

@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 in general, main points:

  • I only took a cursory look at the snapshots, they LGTM, but didn't comb through them extensively
  • The resource names kinda suck, is that the best we can do? 😢
  • We can probably do a small optimization to the userInfo scenario for the Url normalization

// HTTP methods are case-sensitive, but the libraries we instrument are not always,
// so treat a case-insensitive match as the canonical method. The original value is
// reported separately in "http.request.method_original".
return CanonicalRequestMethods.TryGetValue(httpMethod, out var canonicalMethod)

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.

nit: potentially faster to inline the string.Equals checks here too tbh instead of using a dictionary? Doesn't make sense if we're going to pull that data from settings though, only if we hardcode

/// Gets the span name for a request with the provided "http.request.method" value, when no
/// low-cardinality target is available.
/// </summary>
internal static string GetSpanName(string requestMethod)

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.

nit: this is the resource name in our model, so probably should call it that here too?

Suggested change
internal static string GetSpanName(string requestMethod)
internal static string GetResourceName(string requestMethod)

/// </summary>
internal static string GetSpanName(string requestMethod)
=> string.Equals(requestMethod, OtherRequestMethod, StringComparison.Ordinal)
? UnknownMethodSpanName

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.

I totally understand why we need to just use HTTP, but also, that makes for pretty crap resource names 🙁 Is there nothing else we could/should include in here? e.g. even if it's just the host or something?

How does the Otel auto-instrumentation handle it today?

Comment on lines +78 to +79
// Do not update this when OpenTelemetry semantics are enabled
// since OpenTelemetry semantics supercedes V1Tags

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.

Does this comment need to be here? 🤔 It's potentially "wrong" if you explicitly enable peer service tags, right?

/// <param name="queryStringManager">Used to truncate and obfuscate the query string</param>
internal static string GetUrlFull(Uri uri, QueryStringManager? queryStringManager = null)
{
var userInfo = uri.UserInfo;

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.

Does this trigger any allocation of the underlying values? The UriComponents approach in the previous methods are designed to avoid that, so this might invalidate that path, and push is into the "slow" path Anyway.

Given we end up having to do a bunch of string manipulation afterwards anyway, which would double the allocations, I feel like it probably makes more sense to just re-implement the basic case either way?

e.g.

var userInfo = uri.UserInfo;
if (StringUtil.IsNullOrEmpty(userInfo))
{
    return GetUrl(uri, queryStringManager);;
}

var redacted = userInfo.IndexOf(':') >= 0 ? RedactedUserNameAndPassword : RedactedUserName;
var queryString = queryStringManager?.TruncateAndObfuscate(uri.Query) ?? string.Empty;

return uri.IsDefaultPort
           ? $"{uri.Scheme}://{redacted}{uri.Host}{uri.AbsolutePath}{queryString}"
           : FormattableString.Invariant($"{uri.Scheme}://{redacted}{uri.Host}:{uri.Port}{uri.AbsolutePath}{queryString}");

private void NormalizeWebRequestSpans(JToken tracesRequests, OtlpFieldNames names)
{
// The sample's HttpListener binds a random port each run. url.full is covered by
// VerifyHelper's localhost:<port> scrubber, but server.port carries the bare number.

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.

This can probably be added to the standard Verify scrubbers do you think?

Comment on lines +191 to +194
// .NET 9.0 changed the behaviour when AllowWriteStreamBuffering=false
// The net result is that we end up creating a "WebRequest" span instead
// of an "HttpClient" span in one of the cases. Rather than creating a whole
// separate set of snapshots for .NET 9+, just "fixing" that one span instead.

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.

oh maaaaaan 😅

[InlineData("v1")]
[InlineData("v0")]
[InlineData(null)]
public async Task CreateOutboundHttpScope_WithOpenTelemetrySemantics_NeverUsesV1SchemaTags(string requestedSchemaVersion)

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.

"never", except if you explicitly enable peer tags, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants