Skip to content

Exclude Otel for MongoDb 3.7#8279

Merged
andrewlock merged 2 commits into
masterfrom
andrew/support-latest-mongodb
Mar 10, 2026
Merged

Exclude Otel for MongoDb 3.7#8279
andrewlock merged 2 commits into
masterfrom
andrew/support-latest-mongodb

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

Adds MongoDB.Driver to the Activity ignore handler, to avoid duplicate instrumentations

Reason for change

MongoDB .NET driver v3.7.0 adds support for OpenTelemetry, but this results in duplicate instrumentations for our MongoDb instrumentation. You can see this in play in the test-package-version PR here

An AI analysis (shown in full below), has the following summary:

Cannot replace custom instrumentation with OTel spans. Key blockers:

  1. No query body (mongodb.query) — This is the most valuable tag for debugging and is completely absent from OTel spans
  2. Wrong span type (http instead of mongodb) — Would break DB categorization in Datadog UI
  3. Wrong span name (client.request instead of mongodb.query) — Loses MongoDB-specific identification
  4. No separate service name in SchemaV0 — Breaks service map topology
  5. Doubled span count — 30 extra spans per trace adds overhead

There's a bunch of other tag differences, some of which may or may-not be a problem, but the fact they don't tag the query body likely precludes us deferring to the otel approach, as it would be crucial lacking information.

AI analysis comparing custom instrumentation to OTel

MongoDB 3.7.0 OTel Instrumentation Analysis

Context

MongoDB.Driver 3.7.0 adds built-in OpenTelemetry instrumentation. When used with our existing dd-trace-dotnet custom instrumentation, this creates duplicate/overlapping spans. We need to determine whether the OTel spans can replace our custom instrumentation, or whether we should disable them.

This analysis is based on the diff at mongodb.diff, which compares the SchemaV0 snapshot for the 3_0 package version (before) against the new output with MongoDB 3.7.0 (after).


Span Count Change

Before (3.0) After (3.7.0)
App spans (internal) 4 4
DD mongodb.query spans 16 15
OTel Level 1 spans (logical operation) 0 15
OTel Level 2 spans (wire command) 0 15
Total 20 49

The span count more than doubles: +30 new OTel spans (15 L1 + 15 L2).

Note: the "before" count has 16 mongodb.query spans vs 15 in "after". The initial find that was directly under Main() (Id_2) now has an OTel L1 parent (Id_6), and there's one fewer mongodb.query span for the countDocuments operations - actually looking more carefully, the count is the same (15 DD spans each for the 3 groups of sync/async x 5 operations + 1 initial find = 16... let me recount). Actually both before and after have 15 mongodb.query spans - same count. The diff just renumbers IDs.


New Span Hierarchy

Before (2-tier):

App span (e.g., "sync-calls")
  └── mongodb.query (our custom instrumentation)

After (4-tier):

App span (e.g., "sync-calls")
  └── OTel L1 - "client.request" (logical operation)
       └── mongodb.query (our custom instrumentation, RE-PARENTED)
            └── OTel L2 - "client.request" (wire protocol command)

Our mongodb.query spans are now sandwiched between two OTel spans. The OTel L1 span becomes the parent of our span, and our span becomes the parent of the OTel L2 span.


Two Levels of OTel Spans

OTel Level 1 — Logical Operation Spans

Property Value
Name client.request
Resource <operation> <db>.<collection> (e.g., find test-db.employees)
Service Samples.MongoDB (app service name, NOT separate)
Type http (incorrect for a DB span!)
span.kind client

Tags:

  • db.collection.name: e.g., employees
  • db.namespace: e.g., test-db
  • db.operation.name: e.g., find, delete, insert, countDocuments
  • db.operation.summary: e.g., find test-db.employees
  • db.system.name: mongodb
  • otel.library.name: MongoDB.Driver
  • otel.library.version: 3.7.0
  • otel.status_code: STATUS_CODE_OK

No metrics. No host/port info at this level.

OTel Level 2 — Wire Protocol Command Spans

Property Value
Name client.request
Resource <command> (e.g., find, delete, aggregate) — just the command, no db name
Service Samples.MongoDB (app service name)
Type http (incorrect for a DB span!)
span.kind client

Tags:

  • db.collection.name: e.g., employees
  • db.command.name: e.g., find, delete, insert, aggregate
  • db.mongodb.lsid: Session ID (BSON)
  • db.namespace: e.g., test-db
  • db.query.summary: e.g., find test-db.employees
  • db.system.name: mongodb
  • network.transport: tcp
  • server.address: e.g., mongo
  • otel.library.name: MongoDB.Driver
  • otel.library.version: 3.7.0
  • otel.status_code: STATUS_CODE_OK

Metrics:

  • db.mongodb.driver_connection_id: e.g., 3.0
  • db.mongodb.server_connection_id: e.g., 7.0
  • server.port: e.g., 27017.0

Tag-by-Tag Comparison: OTel Spans vs DD Custom Spans

DD Custom mongodb.query span tags:

Tag DD Value OTel L1 Equivalent OTel L2 Equivalent
component MongoDb MISSING MISSING
db.name test-db db.namespace = test-db db.namespace = test-db
mongodb.collection employees db.collection.name = employees db.collection.name = employees
mongodb.query Full BSON query JSON MISSING MISSING
out.host mongo MISSING server.address = mongo
out.port 27017 MISSING server.port = 27017.0 (metric)
span.kind client client client
_dd.base_service Samples.MongoDB N/A N/A

DD Custom span properties:

Property DD Value OTel L1 OTel L2
Name mongodb.query client.request client.request
Resource <op> <db> (e.g., find test-db) <op> <db>.<coll> (e.g., find test-db.employees) <command> (e.g., find)
Service Samples.MongoDB-mongodb (SchemaV0) Samples.MongoDB Samples.MongoDB
Type mongodb http http

Tags present in OTel but NOT in DD custom spans:

  • db.operation.name / db.command.name
  • db.operation.summary / db.query.summary
  • db.system.name
  • db.mongodb.lsid (session ID - L2 only)
  • network.transport (L2 only)
  • server.address (L2 only — similar to out.host)
  • otel.library.name, otel.library.version
  • otel.status_code

Metrics present in OTel but NOT in DD custom spans:

  • db.mongodb.driver_connection_id (L2 only)
  • db.mongodb.server_connection_id (L2 only)
  • server.port (L2 only — similar to out.port)

Operation Name Mapping: countDocuments vs aggregate

Notable: The OTel L1 span uses the logical operation name countDocuments, while our DD custom span (and OTel L2) use the wire protocol command aggregate. This is because MongoDB implements countDocuments() as an aggregate pipeline internally. The OTel L1 span provides the more user-friendly logical name.


Critical Gaps if Replacing DD Custom with OTel

1. mongodb.query tag — MISSING from OTel

The full BSON query body is the most significant tag in our custom instrumentation. Neither OTel level provides this. The OTel spans only include db.query.summary (e.g., find test-db.employees) which is just the operation + namespace, not the actual query filter/pipeline.

2. Span Type — http instead of mongodb

Both OTel span levels use Type http, while our custom spans correctly use Type mongodb. This affects categorization in the Datadog UI (DB queries vs HTTP calls).

3. Span Name — client.request instead of mongodb.query

Generic OTel name vs our specific operation name.

4. Service Name — No separate service (SchemaV0)

In SchemaV0, our custom spans use Samples.MongoDB-mongodb (separate service), while OTel spans use the app service name Samples.MongoDB. This means no dedicated MongoDB service in the service map.

5. Resource Name — Different format

  • DD: find test-db (operation + database)
  • OTel L1: find test-db.employees (operation + db.collection — more specific, arguably better)
  • OTel L2: find (just the command — less useful)

6. component tag — MISSING from OTel

Our DD spans set component: MongoDb. OTel spans don't have this.


What OTel Does Better

  1. Collection name in resource: find test-db.employees is more informative than find test-db
  2. Logical operation names: countDocuments instead of aggregate (L1 only)
  3. Connection metadata: driver_connection_id, server_connection_id, network.transport
  4. Session tracking: db.mongodb.lsid
  5. Semantic conventions: Uses standard OTel DB semantic conventions (db.namespace, db.system.name, etc.)

Summary / Recommendation

Cannot replace custom instrumentation with OTel spans. Key blockers:

  1. No query body (mongodb.query) — This is the most valuable tag for debugging and is completely absent from OTel spans
  2. Wrong span type (http instead of mongodb) — Would break DB categorization in Datadog UI
  3. Wrong span name (client.request instead of mongodb.query) — Loses MongoDB-specific identification
  4. No separate service name in SchemaV0 — Breaks service map topology
  5. Doubled span count — 30 extra spans per trace adds overhead

Recommended approach: Disable the OTel instrumentation for MongoDB 3.7.0+ to maintain the existing behavior. This likely means either:

  • Suppressing the MongoDB.Driver OTel ActivitySource at startup
  • Or adjusting the integration to detect and skip OTel span creation when our instrumentation is active

If keeping both is desired for any reason, the OTel spans should at minimum be filtered out from the test snapshots, and ideally suppressed at runtime to avoid the 2.5x span multiplication.

Implementation details

Add MongoDB.Driver to the activity ignore list.

Test coverage

Bumped the tests to run with 3.7.0, so should be covered

Other details

I do wonder if this is definitely the approach we should be taking, but let's take that offline

@andrewlock andrewlock added the area:dependabot dependabot updates label Mar 9, 2026
@andrewlock andrewlock requested review from a team as code owners March 9, 2026 11:45
@andrewlock andrewlock requested a review from a team as a code owner March 9, 2026 11:45
@andrewlock andrewlock requested a review from anna-git March 9, 2026 11:45

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

ℹ️ 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/build/supported_versions.json
@pr-commenter

pr-commenter Bot commented Mar 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-03-09 12:26:21

Comparing candidate commit d5a821b in PR branch andrew/support-latest-mongodb with baseline commit e7ebff0 in branch master.

Found 2 performance improvements and 9 performance regressions! Performance is the same for 163 metrics, 18 unstable metrics.

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

  • 🟥 execution_time [+9.964ms; +15.137ms] or [+5.088%; +7.730%]

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

  • 🟩 execution_time [-21.694ms; -15.283ms] or [-10.019%; -7.058%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 throughput [-148.035op/s; -90.359op/s] or [-14.084%; -8.596%]

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

  • 🟥 execution_time [+46.011ms; +54.904ms] or [+31.444%; +37.522%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 throughput [-27193.866op/s; -25269.047op/s] or [-8.590%; -7.982%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 throughput [-24919.426op/s; -23072.004op/s] or [-7.952%; -7.363%]

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

  • 🟥 execution_time [+12.646ms; +16.620ms] or [+6.426%; +8.446%]

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

  • 🟥 execution_time [+8.691ms; +12.204ms] or [+10.287%; +14.445%]

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

  • 🟩 throughput [+14546150.310op/s; +15547249.443op/s] or [+6.437%; +6.880%]

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

  • 🟥 execution_time [+13.091ms; +17.025ms] or [+6.554%; +8.523%]

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

  • 🟥 execution_time [+11.187ms; +16.444ms] or [+5.666%; +8.329%]

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8279) 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
duration74.50 ± (74.44 - 74.74) ms74.42 ± (74.45 - 74.73) ms-0.1%
.NET Framework 4.8 - Bailout
duration78.87 ± (78.83 - 79.24) ms79.00 ± (78.93 - 79.29) ms+0.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1074.20 ± (1074.90 - 1080.77) ms1077.09 ± (1078.35 - 1084.38) ms+0.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.52 ± (22.48 - 22.55) ms22.76 ± (22.68 - 22.85) ms+1.1%✅⬆️
process.time_to_main_ms85.57 ± (85.39 - 85.76) ms87.01 ± (86.60 - 87.41) ms+1.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.92) MB10.92 ± (10.92 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.59 ± (22.54 - 22.63) ms22.57 ± (22.52 - 22.61) ms-0.1%
process.time_to_main_ms86.78 ± (86.56 - 86.99) ms87.06 ± (86.87 - 87.24) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.95 - 10.95) MB10.95 ± (10.94 - 10.95) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms245.91 ± (241.88 - 249.94) ms249.21 ± (245.19 - 253.23) ms+1.3%✅⬆️
process.time_to_main_ms491.00 ± (490.36 - 491.65) ms494.42 ± (493.64 - 495.21) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.59 ± (47.57 - 47.62) MB47.64 ± (47.62 - 47.66) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.57 ± (21.53 - 21.61) ms21.42 ± (21.38 - 21.45) ms-0.7%
process.time_to_main_ms75.19 ± (75.04 - 75.35) ms74.66 ± (74.48 - 74.84) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.63 - 10.64) MB10.66 ± (10.65 - 10.66) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.51 ± (21.46 - 21.56) ms21.46 ± (21.42 - 21.50) ms-0.2%
process.time_to_main_ms76.34 ± (76.13 - 76.54) ms75.90 ± (75.75 - 76.06) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.68 ± (10.67 - 10.68) MB10.76 ± (10.76 - 10.76) MB+0.8%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms247.09 ± (243.24 - 250.94) ms250.21 ± (246.47 - 253.96) ms+1.3%✅⬆️
process.time_to_main_ms470.44 ± (469.76 - 471.13) ms475.19 ± (474.43 - 475.96) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.32 ± (48.30 - 48.35) MB48.36 ± (48.34 - 48.38) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.59 ± (19.56 - 19.62) ms19.85 ± (19.81 - 19.90) ms+1.3%✅⬆️
process.time_to_main_ms74.09 ± (73.92 - 74.27) ms74.44 ± (74.29 - 74.60) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.65 ± (7.65 - 7.66) MB7.67 ± (7.66 - 7.67) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.67 ± (19.63 - 19.72) ms19.83 ± (19.78 - 19.88) ms+0.8%✅⬆️
process.time_to_main_ms75.27 ± (75.07 - 75.46) ms75.84 ± (75.68 - 76.01) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.71 - 7.74) MB7.72 ± (7.71 - 7.73) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms187.99 ± (187.14 - 188.84) ms190.75 ± (189.99 - 191.50) ms+1.5%✅⬆️
process.time_to_main_ms452.37 ± (451.66 - 453.09) ms459.15 ± (458.20 - 460.11) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.03 ± (36.00 - 36.06) MB36.13 ± (36.09 - 36.17) MB+0.3%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.2%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration195.08 ± (195.10 - 195.94) ms195.07 ± (195.04 - 195.84) ms-0.0%
.NET Framework 4.8 - Bailout
duration198.95 ± (198.82 - 199.55) ms198.81 ± (198.50 - 198.99) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1149.74 ± (1150.21 - 1156.96) ms1147.03 ± (1151.97 - 1160.33) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms188.68 ± (188.24 - 189.11) ms188.79 ± (188.40 - 189.18) ms+0.1%✅⬆️
process.time_to_main_ms81.90 ± (81.65 - 82.14) ms81.72 ± (81.50 - 81.95) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.17) MB16.12 ± (16.09 - 16.15) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms188.63 ± (188.20 - 189.06) ms188.84 ± (188.42 - 189.26) ms+0.1%✅⬆️
process.time_to_main_ms83.30 ± (83.09 - 83.51) ms83.53 ± (83.35 - 83.71) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.18 ± (16.15 - 16.20) MB16.26 ± (16.24 - 16.29) MB+0.5%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)+0.1%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms439.99 ± (437.94 - 442.04) ms439.82 ± (437.30 - 442.33) ms-0.0%
process.time_to_main_ms475.69 ± (475.22 - 476.16) ms477.98 ± (477.37 - 478.59) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.11 ± (58.00 - 58.23) MB58.00 ± (57.88 - 58.12) MB-0.2%
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 30)-0.1%
.NET 6 - Baseline
process.internal_duration_ms192.55 ± (192.10 - 193.01) ms193.15 ± (192.73 - 193.58) ms+0.3%✅⬆️
process.time_to_main_ms70.64 ± (70.44 - 70.83) ms71.44 ± (71.21 - 71.68) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.03 - 16.29) MB16.00 ± (15.84 - 16.15) MB-1.0%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.1%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.10 ± (190.72 - 191.49) ms192.04 ± (191.76 - 192.33) ms+0.5%✅⬆️
process.time_to_main_ms71.55 ± (71.41 - 71.69) ms72.09 ± (71.94 - 72.24) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.02 ± (15.87 - 16.18) MB16.35 ± (16.25 - 16.45) MB+2.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (19 - 20)+3.0%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms453.08 ± (451.46 - 454.71) ms452.48 ± (450.49 - 454.47) ms-0.1%
process.time_to_main_ms452.40 ± (451.85 - 452.95) ms452.34 ± (451.71 - 452.96) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.01 ± (57.92 - 58.10) MB58.03 ± (57.90 - 58.16) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 8 - Baseline
process.internal_duration_ms190.45 ± (190.14 - 190.77) ms191.27 ± (190.98 - 191.55) ms+0.4%✅⬆️
process.time_to_main_ms70.08 ± (69.91 - 70.26) ms70.36 ± (70.18 - 70.53) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.80) MB11.81 ± (11.78 - 11.84) MB+0.3%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-1.4%
.NET 8 - Bailout
process.internal_duration_ms190.08 ± (189.72 - 190.45) ms190.96 ± (190.62 - 191.30) ms+0.5%✅⬆️
process.time_to_main_ms71.20 ± (71.11 - 71.30) ms71.64 ± (71.49 - 71.79) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.78 - 11.82) MB11.82 ± (11.79 - 11.84) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms367.94 ± (366.52 - 369.35) ms367.27 ± (365.86 - 368.67) ms-0.2%
process.time_to_main_ms435.35 ± (434.76 - 435.94) ms436.71 ± (436.13 - 437.29) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.77 ± (47.74 - 47.81) MB47.77 ± (47.73 - 47.81) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
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 (8279) - mean (75ms)  : 73, 77
    master - mean (75ms)  : 72, 77

    section Bailout
    This PR (8279) - mean (79ms)  : 77, 81
    master - mean (79ms)  : 77, 81

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (1,081ms)  : 1037, 1126
    master - mean (1,078ms)  : 1035, 1121

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 (8279) - mean (117ms)  : 108, 126
    master - mean (115ms)  : 111, 119

    section Bailout
    This PR (8279) - mean (117ms)  : 114, 119
    master - mean (116ms)  : 114, 119

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (779ms)  : 712, 847
    master - mean (770ms)  : 712, 827

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8279) - mean (103ms)  : 99, 106
    master - mean (103ms)  : 100, 107

    section Bailout
    This PR (8279) - mean (104ms)  : 102, 106
    master - mean (104ms)  : 102, 107

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (757ms)  : 689, 826
    master - mean (748ms)  : 680, 817

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

    section Bailout
    This PR (8279) - mean (104ms)  : 102, 106
    master - mean (103ms)  : 100, 105

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (685ms)  : 652, 717
    master - mean (670ms)  : 651, 689

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 (8279) - mean (195ms)  : 191, 200
    master - mean (196ms)  : 191, 200

    section Bailout
    This PR (8279) - mean (199ms)  : 196, 201
    master - mean (199ms)  : 196, 203

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (1,156ms)  : 1094, 1218
    master - mean (1,154ms)  : 1105, 1202

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 (8279) - mean (279ms)  : 273, 286
    master - mean (279ms)  : 273, 285

    section Bailout
    This PR (8279) - mean (281ms)  : 276, 285
    master - mean (281ms)  : 273, 289

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (947ms)  : 906, 987
    master - mean (946ms)  : 907, 986

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8279) - mean (273ms)  : 267, 279
    master - mean (272ms)  : 266, 277

    section Bailout
    This PR (8279) - mean (272ms)  : 269, 276
    master - mean (271ms)  : 265, 277

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (934ms)  : 907, 961
    master - mean (935ms)  : 911, 959

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8279) - mean (271ms)  : 267, 275
    master - mean (270ms)  : 266, 275

    section Bailout
    This PR (8279) - mean (272ms)  : 268, 277
    master - mean (271ms)  : 266, 275

    section CallTarget+Inlining+NGEN
    This PR (8279) - mean (835ms)  : 815, 854
    master - mean (835ms)  : 811, 859

Loading

@bouwkast bouwkast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

I do wonder if this is definitely the approach we should be taking, but let's take that offline

In case anyone hits this and gets duplicated spans prior to this being released we have DD_TRACE_DISABLED_ACTIVITY_SOURCES which is configurable, but this Ignore one isn't. However they also work in slightly different ways and have some behavioral differences

DD_TRACE_DISABLED_ACTIVITY_SOURCES=MongoDB.Driver

@andrewlock andrewlock merged commit f675c92 into master Mar 10, 2026
144 checks passed
@andrewlock andrewlock deleted the andrew/support-latest-mongodb branch March 10, 2026 16:45
@github-actions github-actions Bot added this to the vNext-v3 milestone Mar 10, 2026
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.

3 participants