Skip to content

Conversation

@andrewlock
Copy link
Member

@andrewlock andrewlock commented Oct 30, 2025

Summary of changes

Updates a couple of places where we're calling Tracer.Instance where we don't need to

Reason for change

In one of my other PRs I accidentally broke something that should only have affected integration tests, but a bunch of unit tests broke. It highlighted where they were using Tracer.Instance and setting the global tracer for tests. In other places, it revealed that code that tests that looked independent of other tests really wasn't...

Calling Tracer.Instance potentially does a lot of work, as it initializes the tracer. It's also hard to follow if we're making static calls out in places we don't need to. So just pass through the settings we want instead.

Implementation details

Instead of calling Tracer.Instance.Settings, use the value of Tracer or TracerSettings that's already available wherever possible. It makes the tests cleaner too.

Test coverage

Same coverage, just a bit cleaner

Other details

Included as part of the config stack, just because I already refactored some of this code, and can't be bothered to faff with merge conflicts:

https://datadoghq.atlassian.net/browse/LANGPLAT-819

@andrewlock andrewlock requested review from a team as code owners October 30, 2025 17:42
@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:tests unit tests, integration tests type:reliability area:data-streams-monitoring labels Oct 30, 2025
CommandType = typeof(TCommand);

if (TryGetIntegrationDetails(CommandType.FullName, out var integrationId, out var dbTypeName))
if (TryGetIntegrationDetails(Tracer.Instance.Settings.DisabledAdoNetCommandTypes, CommandType.FullName, out var integrationId, out var dbTypeName))
Copy link
Member Author

Choose a reason for hiding this comment

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

This one is actually kind of annoying. As it's in a static cctor, we can't pass it in anywhere, which means there's one DbScopeFactoryTests test which will use this and end up initializing the global tracer. Oh well.

Copy link
Collaborator

@bouwkast bouwkast Oct 30, 2025

Choose a reason for hiding this comment

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

:sorry: pretty sure this was me

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I understand that we want to minimize work but I feel like we should calculate all DbCommands regardless of config (i.e. no dependency here) and then we do the config check on the hot path, which allows this setting to be hot-reloadable or "config at runtime" ready

Copy link
Contributor

@zacharycmontoya zacharycmontoya Oct 30, 2025

Choose a reason for hiding this comment

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

Concretely, I'm suggesting that we remove the TryGetIntegrationDetails call in the static constructor of Cache<TCommand> and refactor the other call in CreateDbCommandScope a bit. Perhaps in a separate PR

Copy link
Member Author

Choose a reason for hiding this comment

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

I can see arguments both ways tbh.

The only downside to @zacharycmontoya's proposal would be more work to do for custom DbCommands (ones that we don't explicitly know about), which are also marked as disabled initially, and which customers have marked as disabled. The question I would have is whether that's ok - e.g. if they're disabled because we're erroring out literally running TryGetIntegrationDetails, and that's why they disabled it, then that could be a problem. If it's just an optimization, then yes, it probably is fine.

That said, this actually is technically already hot-reloadable. The DisabledAdoNetCommandTypes setting passed in here is used to decide whether to populate the cache for custom types, but if we don't populate the cache, then we run TryGetIntegrationDetails() and check DisabledAdoNetCommandTypes at runtime anyway. So if this changes, then the result changes, it will just never be cached in that scenario.

So on that basis, I think removing the TryGetIntegrationDetails has a small amount of risk (if customer disabled adonet due to errors - not sure if that's really possible, but I can believe it), means a small bit more work (calculating values which will never be used), and doesn't change how hot-reloadable we are in general (though if we made it hot reloadable, we'd have to rethink how caching works). The plus side is it removes the static access to Tracer.Instance which is better for tests.

So yeah, I'm torn 🤷‍♂️ I'd say separate PR either way, given the questions, as the current behaviour in this PR is identical to the existing. But it's worth thinking about

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Oct 30, 2025

⚠️ Tests

⚠️ Warnings

🧪 3 Tests failed

SubmitsTraces from Datadog.Trace.ClrProfiler.IntegrationTests.WcfTests (Datadog)

      } version: 1.0.0et,tests,dd,d,0000/WcfSample/123,123/CalculatorService,NewWcfInstrumentation=False_enableWcfObfuscation=False.verified.txt
DoesNotFireAfterUnsubscribing from Datadog.Trace.Tests.Agent.DiscoveryServiceTests (Datadog)
Expected Volatile.Read(ref notificationCount) to be True because Should make third request to api, but found False.
IpcClientTest from Datadog.Trace.Tests.Ci.Ipc.IpcTests (Datadog)
Timeout waiting for messages. Values went up to [20, 20]

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0e2c7d3 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

CommandType = typeof(TCommand);

if (TryGetIntegrationDetails(CommandType.FullName, out var integrationId, out var dbTypeName))
if (TryGetIntegrationDetails(Tracer.Instance.Settings.DisabledAdoNetCommandTypes, CommandType.FullName, out var integrationId, out var dbTypeName))
Copy link
Collaborator

@bouwkast bouwkast Oct 30, 2025

Choose a reason for hiding this comment

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

:sorry: pretty sure this was me

[Fact]
public void CanRoundTripPathwayContext()
[Theory]
[CombinatorialData]
Copy link
Collaborator

Choose a reason for hiding this comment

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

😃

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Oct 30, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7744) 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
duration75.54 ± (75.66 - 76.57) ms74.67 ± (74.88 - 75.67) ms-1.1%
.NET Framework 4.8 - Bailout
duration78.44 ± (78.48 - 79.27) ms78.26 ± (78.14 - 78.84) ms-0.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1056.60 ± (1061.10 - 1072.97) ms1052.61 ± (1052.33 - 1059.25) ms-0.4%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.97 ± (22.88 - 23.06) ms23.03 ± (22.94 - 23.11) ms+0.3%✅⬆️
process.time_to_main_ms87.39 ± (86.98 - 87.79) ms87.55 ± (87.18 - 87.91) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.94) MB10.94 ± (10.93 - 10.94) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.71 ± (22.65 - 22.77) ms22.89 ± (22.82 - 22.96) ms+0.8%✅⬆️
process.time_to_main_ms87.50 ± (87.17 - 87.84) ms88.98 ± (88.58 - 89.39) ms+1.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.97) MB10.97 ± (10.97 - 10.97) MB+0.0%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms219.96 ± (218.38 - 221.54) ms223.14 ± (221.85 - 224.43) ms+1.4%✅⬆️
process.time_to_main_ms496.03 ± (494.81 - 497.24) ms501.00 ± (499.82 - 502.18) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.77 ± (47.75 - 47.79) MB47.92 ± (47.90 - 47.94) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 6 - Baseline
process.internal_duration_ms21.76 ± (21.68 - 21.83) ms21.73 ± (21.66 - 21.80) ms-0.1%
process.time_to_main_ms75.80 ± (75.44 - 76.15) ms76.11 ± (75.81 - 76.40) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.62 - 10.63) MB10.64 ± (10.64 - 10.65) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.81 ± (21.74 - 21.88) ms21.84 ± (21.76 - 21.91) ms+0.1%✅⬆️
process.time_to_main_ms77.97 ± (77.66 - 78.28) ms77.76 ± (77.44 - 78.07) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.70 ± (10.70 - 10.71) MB10.68 ± (10.68 - 10.68) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms211.50 ± (210.08 - 212.92) ms212.92 ± (211.75 - 214.09) ms+0.7%✅⬆️
process.time_to_main_ms467.65 ± (466.65 - 468.65) ms471.77 ± (470.70 - 472.83) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.99 ± (47.97 - 48.02) MB48.15 ± (48.13 - 48.17) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms20.16 ± (20.08 - 20.23) ms20.01 ± (19.95 - 20.08) ms-0.7%
process.time_to_main_ms76.89 ± (76.50 - 77.28) ms76.03 ± (75.74 - 76.33) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.67 ± (7.67 - 7.68) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.83 ± (19.77 - 19.88) ms20.21 ± (20.12 - 20.30) ms+1.9%✅⬆️
process.time_to_main_ms76.76 ± (76.39 - 77.13) ms78.30 ± (77.86 - 78.75) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.73) MB7.72 ± (7.72 - 7.73) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms191.97 ± (191.08 - 192.85) ms195.76 ± (194.82 - 196.69) ms+2.0%✅⬆️
process.time_to_main_ms454.27 ± (453.29 - 455.25) ms458.41 ± (457.44 - 459.38) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.49 ± (36.45 - 36.53) MB36.50 ± (36.46 - 36.54) MB+0.0%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration194.92 ± (194.70 - 195.36) ms196.38 ± (196.09 - 196.90) ms+0.7%✅⬆️
.NET Framework 4.8 - Bailout
duration198.30 ± (198.03 - 198.51) ms200.26 ± (200.24 - 200.88) ms+1.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1123.56 ± (1125.23 - 1133.30) ms1170.62 ± (1165.20 - 1173.65) ms+4.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms190.14 ± (189.82 - 190.46) ms197.08 ± (196.53 - 197.63) ms+3.7%✅⬆️
process.time_to_main_ms81.84 ± (81.64 - 82.03) ms85.13 ± (84.82 - 85.45) ms+4.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.04 - 16.09) MB16.03 ± (16.01 - 16.05) MB-0.2%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.0%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms190.16 ± (189.76 - 190.57) ms192.51 ± (192.02 - 193.00) ms+1.2%✅⬆️
process.time_to_main_ms83.18 ± (82.97 - 83.39) ms84.30 ± (84.04 - 84.55) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.12 - 16.16) MB16.16 ± (16.14 - 16.18) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.5%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms407.30 ± (404.37 - 410.23) ms407.40 ± (405.66 - 409.14) ms+0.0%✅⬆️
process.time_to_main_ms478.02 ± (477.48 - 478.57) ms485.01 ± (484.32 - 485.70) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.85 ± (58.75 - 58.95) MB59.12 ± (59.08 - 59.16) MB+0.5%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)-0.1%
.NET 6 - Baseline
process.internal_duration_ms193.89 ± (193.56 - 194.22) ms196.26 ± (195.84 - 196.69) ms+1.2%✅⬆️
process.time_to_main_ms70.73 ± (70.57 - 70.89) ms72.01 ± (71.81 - 72.21) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.40 ± (16.37 - 16.43) MB16.41 ± (16.38 - 16.44) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+1.0%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms194.00 ± (193.71 - 194.28) ms199.90 ± (199.31 - 200.49) ms+3.0%✅⬆️
process.time_to_main_ms72.27 ± (72.11 - 72.42) ms74.27 ± (74.03 - 74.51) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.23 - 16.44) MB16.37 ± (16.35 - 16.39) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+2.6%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms418.71 ± (416.09 - 421.34) ms422.06 ± (420.53 - 423.58) ms+0.8%✅⬆️
process.time_to_main_ms447.45 ± (446.80 - 448.09) ms454.00 ± (453.25 - 454.75) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed59.26 ± (59.16 - 59.36) MB59.48 ± (59.42 - 59.53) MB+0.4%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 29)-0.4%
.NET 8 - Baseline
process.internal_duration_ms192.07 ± (191.81 - 192.34) ms196.76 ± (196.30 - 197.22) ms+2.4%✅⬆️
process.time_to_main_ms70.67 ± (70.47 - 70.87) ms72.05 ± (71.78 - 72.31) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.74 - 11.78) MB11.72 ± (11.70 - 11.74) MB-0.3%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.7%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms191.55 ± (191.29 - 191.80) ms195.79 ± (195.34 - 196.24) ms+2.2%✅⬆️
process.time_to_main_ms71.50 ± (71.40 - 71.60) ms73.00 ± (72.83 - 73.17) ms+2.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.83 ± (11.80 - 11.85) MB11.73 ± (11.71 - 11.75) MB-0.8%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms370.49 ± (369.13 - 371.86) ms375.03 ± (373.53 - 376.53) ms+1.2%✅⬆️
process.time_to_main_ms438.32 ± (437.58 - 439.07) ms443.91 ± (442.92 - 444.90) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.88 ± (47.84 - 47.91) MB47.85 ± (47.81 - 47.88) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (28 - 29)-1.3%
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 (7744) - mean (75ms)  : 69, 81
    master - mean (76ms)  : 70, 83

    section Bailout
    This PR (7744) - mean (78ms)  : 73, 84
    master - mean (79ms)  : 73, 85

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (1,056ms)  : 1006, 1105
    master - mean (1,067ms)  : 976, 1158

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 (7744) - mean (118ms)  : 111, 125
    master - mean (118ms)  : 111, 125

    section Bailout
    This PR (7744) - mean (119ms)  : 113, 126
    master - mean (118ms)  : 111, 125

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (764ms)  : 732, 796
    master - mean (758ms)  : 720, 796

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7744) - mean (105ms)  : 100, 110
    master - mean (105ms)  : 98, 111

    section Bailout
    This PR (7744) - mean (107ms)  : 101, 113
    master - mean (107ms)  : 100, 114

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (722ms)  : 684, 761
    master - mean (719ms)  : 677, 762

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

    section Bailout
    This PR (7744) - mean (108ms)  : 99, 117
    master - mean (105ms)  : 98, 112

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (697ms)  : 669, 725
    master - mean (690ms)  : 661, 720

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 (7744) - mean (196ms)  : 192, 200
    master - mean (195ms)  : 192, 198

    section Bailout
    This PR (7744) - mean (201ms)  : 197, 204
    master - mean (198ms)  : 196, 201

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (1,169ms)  : 1104, 1234
    master - mean (1,129ms)  : 1071, 1188

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 (7744) - mean (291ms)  : 278, 304
    master - mean (280ms)  : 276, 285

    section Bailout
    This PR (7744) - mean (286ms)  : 279, 292
    master - mean (281ms)  : 276, 287

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (934ms)  : 900, 968
    master - mean (924ms)  : 880, 969

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7744) - mean (277ms)  : 270, 283
    master - mean (274ms)  : 267, 280

    section Bailout
    This PR (7744) - mean (282ms)  : 269, 296
    master - mean (275ms)  : 270, 279

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (911ms)  : 875, 948
    master - mean (902ms)  : 860, 944

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7744) - mean (279ms)  : 271, 286
    master - mean (273ms)  : 267, 278

    section Bailout
    This PR (7744) - mean (279ms)  : 271, 287
    master - mean (273ms)  : 269, 276

    section CallTarget+Inlining+NGEN
    This PR (7744) - mean (853ms)  : 805, 901
    master - mean (839ms)  : 813, 865

Loading

@andrewlock andrewlock force-pushed the andrew/settings/6a-stop-using-tracer-instance branch from 8a3aee6 to 753da8d Compare October 31, 2025 18:04
@andrewlock andrewlock requested review from a team as code owners October 31, 2025 18:04
@andrewlock andrewlock requested review from anna-git and removed request for a team October 31, 2025 18:04
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 1b1f494 to f94e51b Compare October 31, 2025 18:04
@andrewlock andrewlock force-pushed the andrew/settings/6a-stop-using-tracer-instance branch from 753da8d to 3a96423 Compare November 3, 2025 17:30
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from f94e51b to 75937f5 Compare November 3, 2025 17:30
@andrewlock andrewlock force-pushed the andrew/settings/6a-stop-using-tracer-instance branch from 3a96423 to f01f8c6 Compare November 4, 2025 09:26
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 75937f5 to 8111379 Compare November 4, 2025 09:26
@andrewlock andrewlock force-pushed the andrew/settings/6a-stop-using-tracer-instance branch from f01f8c6 to 4fd8303 Compare November 4, 2025 10:30
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 8111379 to 177c2a0 Compare November 4, 2025 10:30
Also:
- slight refactor of LogFormatter to reduce some allocation
- ignore "previous" when creating DirectLogSubmissionManager (seeing as that won't be a thing soon)
…n't respond to changes

I left it like this because the debugger already doesn't respond to changes like other services do
- Move statsd instance creation to separate factory
- Create a StatsdManager to handle automatic updating in response to setting changes
- Always create a statsd instance, as it's hard to know if we're _ever_ going to need one, and reduces some of the compexity
This isn't necessary with the current design, and it causes issues today
Make sure we can't dispose a stats consumer that's in use (as it will throw)
Rework to use a "lease" mechanism to track usages
Make passing in a statsmanager required
The statsd client does sync-over-async in the flush and dispose paths, which can lead to deadlocks and thread exhaustion.
To work around that, we push the dispose to happen on a thread-pool thread instead, in the background
… config changes (#7796)

## Summary of changes

A fix for #7724 to handle telemetry reporting in dynamic config "reset"
scenarios

## Reason for change

The system tests for #7724 were failing in some dynamic configuration
scenarios. Specifically, the tests were sending remote config _without_
any configuration values "i.e. 'reset to use defaults'" and were waiting
a telemetry update. However, we never sent it, because there was "no
telemetry to record".

Note that we _did_ correctly apply the new configuration, we just didn't
report the telemetry correctly, primarily due to limitations in the
telemetry protocol. This PR adds a fix for that, and will be merged into
#7724.

## Implementation details

The solution is to "remember" the telemetry from the default mutable
configuration values, _without_ any dynamic sources, and "replay" this
telemetry when we update telemetry. This feels kind of hacky, but it's
something I suspected we might need to do, and had been avoiding up to
this point because we do a "full reconfigure" anyway.

## Test coverage

Added a specific unit test that mimics the behaviour of the system-test
(i.e. an "empty" dynamic config response) and confirms the telemetry is
recorded as expected

## Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721
- #7722
- #7695
- #7723
- #7724
- #7796 👈

Unlike other PRs in the stack, I'll merge this directly into #7724 to
fix the tests there, just thought I'd keep this separate for easier
reviewing
@andrewlock andrewlock force-pushed the andrew/settings/6a-stop-using-tracer-instance branch from efe95e4 to 0e2c7d3 Compare November 26, 2025 13:34
@andrewlock andrewlock force-pushed the andrew/settings/5-remove-mutablesettings branch from 447027a to 9db67e4 Compare November 26, 2025 13:34
Base automatically changed from andrew/settings/5-remove-mutablesettings to master November 26, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:data-streams-monitoring area:tests unit tests, integration tests area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:reliability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants