Skip to content

Refacto: Make ContainerMetadata an instance class#7898

Merged
vandonr merged 11 commits intomasterfrom
vandonr/refacto
Jan 5, 2026
Merged

Refacto: Make ContainerMetadata an instance class#7898
vandonr merged 11 commits intomasterfrom
vandonr/refacto

Conversation

@vandonr
Copy link
Contributor

@vandonr vandonr commented Dec 3, 2025

Summary of changes

Everything in that class is public static, and it makes more sense to have it as an instance for testability.

Reason for change

Implementation details

Kept the backing fields as static lazy values, to avoid building them twice. In the context of tests, one would create an override/mock and set the values that way.

I didn't really inject it anywhere though, it'd only make sense in the context of tests.
I could take the opportunity to add tests, but also, I'm doing this to add an extra field to the container metadata, so I can do the work then ?

Test coverage

existing tests

Other details

@vandonr vandonr requested a review from a team as a code owner December 3, 2025 15:06
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Dec 3, 2025

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 2 New flaky tests detected

TestDirectoryListingLeak from Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsRestartedSampleIastEnabled (Datadog) (Fix with Cursor)
Unable to determine port application is listening on
RunTest from Datadog.Trace.Security.IntegrationTests.Rcm.AspNetCore5AsmDataSecurityEnabledBlockingUser (Datadog) (Fix with Cursor)
Unable to determine port application is listening on

ℹ️ Info

🧪 All tests passed

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

@pr-commenter
Copy link

pr-commenter bot commented Dec 3, 2025

Benchmarks

Benchmark execution time: 2025-12-31 16:24:11

Comparing candidate commit 9e538ec in PR branch vandonr/refacto with baseline commit 4fb09d3 in branch master.

Found 4 performance improvements and 6 performance regressions! Performance is the same for 161 metrics, 15 unstable metrics.

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

  • 🟥 execution_time [+11.956ms; +17.449ms] or [+6.026%; +8.794%]

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

  • 🟥 execution_time [+14.830ms; +21.148ms] or [+7.489%; +10.679%]

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

  • 🟩 execution_time [-20.123ms; -13.686ms] or [-9.564%; -6.505%]

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

  • 🟥 execution_time [+15.164ms; +21.208ms] or [+7.665%; +10.721%]

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

  • 🟩 execution_time [-19.261ms; -17.852ms] or [-9.600%; -8.897%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 throughput [-108.726op/s; -78.302op/s] or [-9.870%; -7.108%]

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

  • 🟩 execution_time [-930.187µs; -691.926µs] or [-33.300%; -24.770%]

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

  • 🟥 throughput [-3076.397op/s; -1300.880op/s] or [-13.090%; -5.535%]

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

  • 🟩 execution_time [-18.637ms; -14.946ms] or [-9.159%; -7.346%]

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

  • 🟥 execution_time [+16.684ms; +19.960ms] or [+8.457%; +10.118%]

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

dd-trace-dotnet-ci-bot bot commented Dec 3, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7898) 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
duration68.27 ± (68.31 - 68.55) ms69.04 ± (69.07 - 69.28) ms+1.1%✅⬆️
.NET Framework 4.8 - Bailout
duration72.30 ± (72.32 - 72.55) ms73.02 ± (72.94 - 73.19) ms+1.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1002.91 ± (1004.44 - 1009.93) ms1007.98 ± (1011.25 - 1017.73) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.95 ± (21.92 - 21.99) ms21.87 ± (21.84 - 21.90) ms-0.4%
process.time_to_main_ms78.49 ± (78.36 - 78.62) ms78.78 ± (78.63 - 78.93) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.92 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.91 ± (21.88 - 21.93) ms21.80 ± (21.78 - 21.83) ms-0.5%
process.time_to_main_ms79.69 ± (79.59 - 79.79) ms80.17 ± (80.08 - 80.26) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.95 - 10.95) MB10.96 ± (10.95 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms250.47 ± (246.56 - 254.38) ms240.99 ± (236.74 - 245.24) ms-3.8%
process.time_to_main_ms470.76 ± (470.25 - 471.26) ms471.04 ± (470.58 - 471.50) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.17 ± (48.14 - 48.19) MB48.20 ± (48.17 - 48.22) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.2%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms20.67 ± (20.64 - 20.70) ms20.77 ± (20.74 - 20.80) ms+0.5%✅⬆️
process.time_to_main_ms67.96 ± (67.86 - 68.06) ms68.01 ± (67.93 - 68.10) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (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_ms20.49 ± (20.47 - 20.51) ms20.70 ± (20.68 - 20.72) ms+1.0%✅⬆️
process.time_to_main_ms68.71 ± (68.66 - 68.76) ms69.08 ± (69.01 - 69.14) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.68 ± (10.67 - 10.68) MB10.74 ± (10.74 - 10.75) MB+0.6%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms246.51 ± (244.39 - 248.63) ms248.48 ± (247.59 - 249.37) ms+0.8%✅⬆️
process.time_to_main_ms443.22 ± (442.57 - 443.87) ms441.84 ± (441.35 - 442.33) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.72 ± (48.69 - 48.75) MB48.66 ± (48.63 - 48.69) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 8 - Baseline
process.internal_duration_ms18.90 ± (18.88 - 18.92) ms18.90 ± (18.86 - 18.93) ms-0.0%
process.time_to_main_ms67.38 ± (67.26 - 67.49) ms67.05 ± (66.94 - 67.16) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.69 ± (7.68 - 7.70) MB+0.4%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.90 ± (18.87 - 18.93) ms18.91 ± (18.89 - 18.94) ms+0.1%✅⬆️
process.time_to_main_ms68.32 ± (68.26 - 68.38) ms68.19 ± (68.14 - 68.25) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.75 ± (7.74 - 7.77) MB7.74 ± (7.73 - 7.75) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms176.74 ± (175.90 - 177.58) ms179.09 ± (178.30 - 179.89) ms+1.3%✅⬆️
process.time_to_main_ms424.56 ± (424.07 - 425.04) ms426.01 ± (425.52 - 426.51) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.35 ± (36.32 - 36.37) MB36.37 ± (36.35 - 36.40) MB+0.1%✅⬆️
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
duration193.61 ± (193.64 - 194.50) ms194.84 ± (194.55 - 195.49) ms+0.6%✅⬆️
.NET Framework 4.8 - Bailout
duration197.42 ± (197.12 - 197.91) ms197.48 ± (197.44 - 198.21) ms+0.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1110.43 ± (1115.83 - 1129.36) ms1108.47 ± (1109.32 - 1116.17) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms187.58 ± (187.16 - 188.00) ms188.24 ± (187.97 - 188.50) ms+0.4%✅⬆️
process.time_to_main_ms80.81 ± (80.57 - 81.05) ms81.16 ± (80.93 - 81.39) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.09 - 16.14) MB16.12 ± (16.09 - 16.15) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-1.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms186.90 ± (186.66 - 187.14) ms188.25 ± (187.79 - 188.72) ms+0.7%✅⬆️
process.time_to_main_ms81.86 ± (81.72 - 81.99) ms82.52 ± (82.31 - 82.74) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.20 ± (16.17 - 16.23) MB16.21 ± (16.18 - 16.24) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms425.89 ± (422.68 - 429.10) ms426.00 ± (422.64 - 429.36) ms+0.0%✅⬆️
process.time_to_main_ms471.90 ± (471.39 - 472.41) ms473.58 ± (473.03 - 474.12) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.68 ± (58.57 - 58.80) MB58.60 ± (58.49 - 58.71) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms193.09 ± (192.72 - 193.46) ms192.83 ± (192.43 - 193.23) ms-0.1%
process.time_to_main_ms69.99 ± (69.82 - 70.17) ms70.50 ± (70.30 - 70.71) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.32 ± (16.25 - 16.38) MB16.29 ± (16.20 - 16.38) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 6 - Bailout
process.internal_duration_ms191.39 ± (191.07 - 191.71) ms191.77 ± (191.52 - 192.01) ms+0.2%✅⬆️
process.time_to_main_ms70.87 ± (70.75 - 70.99) ms71.08 ± (71.00 - 71.17) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.10 ± (15.95 - 16.25) MB16.37 ± (16.28 - 16.47) MB+1.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.7%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms455.81 ± (454.10 - 457.52) ms451.00 ± (448.26 - 453.74) ms-1.1%
process.time_to_main_ms446.19 ± (445.64 - 446.73) ms447.52 ± (446.97 - 448.06) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.15 ± (58.03 - 58.27) MB58.42 ± (58.30 - 58.54) MB+0.5%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (29 - 30)-0.0%
.NET 8 - Baseline
process.internal_duration_ms189.71 ± (189.36 - 190.05) ms190.74 ± (190.43 - 191.04) ms+0.5%✅⬆️
process.time_to_main_ms69.19 ± (69.02 - 69.35) ms69.46 ± (69.31 - 69.60) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.81) MB11.75 ± (11.72 - 11.78) MB-0.3%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.6%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms190.23 ± (189.94 - 190.51) ms190.16 ± (189.82 - 190.49) ms-0.0%
process.time_to_main_ms70.67 ± (70.57 - 70.77) ms70.65 ± (70.50 - 70.81) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.74 - 11.81) MB11.81 ± (11.78 - 11.83) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms365.65 ± (363.86 - 367.44) ms365.16 ± (363.52 - 366.80) ms-0.1%
process.time_to_main_ms429.26 ± (428.75 - 429.76) ms431.09 ± (430.45 - 431.73) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.95 ± (47.93 - 47.98) MB48.05 ± (48.01 - 48.08) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
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 (7898) - mean (69ms)  : 68, 71
    master - mean (68ms)  : 67, 70

    section Bailout
    This PR (7898) - mean (73ms)  : 72, 74
    master - mean (72ms)  : 71, 74

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (1,014ms)  : 968, 1061
    master - mean (1,007ms)  : 968, 1047

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 (7898) - mean (106ms)  : 104, 108
    master - mean (106ms)  : 103, 109

    section Bailout
    This PR (7898) - mean (107ms)  : 106, 108
    master - mean (107ms)  : 105, 108

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (737ms)  : 666, 809
    master - mean (743ms)  : 680, 805

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7898) - mean (94ms)  : 92, 95
    master - mean (93ms)  : 91, 96

    section Bailout
    This PR (7898) - mean (94ms)  : 94, 95
    master - mean (94ms)  : 93, 95

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (715ms)  : 694, 736
    master - mean (715ms)  : 682, 748

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7898) - mean (92ms)  : 90, 94
    master - mean (92ms)  : 90, 94

    section Bailout
    This PR (7898) - mean (93ms)  : 92, 94
    master - mean (93ms)  : 92, 95

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (633ms)  : 614, 651
    master - mean (629ms)  : 615, 644

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 (7898) - mean (195ms)  : 191, 199
    master - mean (194ms)  : 190, 198

    section Bailout
    This PR (7898) - mean (198ms)  : 194, 202
    master - mean (198ms)  : 194, 201

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (1,113ms)  : 1064, 1162
    master - mean (1,123ms)  : 1045, 1201

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 (7898) - mean (278ms)  : 273, 283
    master - mean (277ms)  : 270, 283

    section Bailout
    This PR (7898) - mean (279ms)  : 272, 286
    master - mean (277ms)  : 274, 280

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (929ms)  : 877, 981
    master - mean (926ms)  : 877, 975

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7898) - mean (271ms)  : 266, 276
    master - mean (271ms)  : 266, 276

    section Bailout
    This PR (7898) - mean (271ms)  : 267, 274
    master - mean (270ms)  : 267, 274

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (927ms)  : 884, 970
    master - mean (931ms)  : 905, 958

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7898) - mean (270ms)  : 266, 274
    master - mean (269ms)  : 265, 273

    section Bailout
    This PR (7898) - mean (270ms)  : 266, 275
    master - mean (270ms)  : 267, 274

    section CallTarget+Inlining+NGEN
    This PR (7898) - mean (828ms)  : 811, 844
    master - mean (826ms)  : 805, 847

Loading

};

if (ContainerMetadata.GetContainerId() is { } containerId)
if (ContainerMetadata.Instance.ContainerId is { } containerId)
Copy link
Member

Choose a reason for hiding this comment

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

don't use global instance here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, after discussing, I think we can use the global here because it's an integration test. I could remove it in favor of the one in JsonTelemetryTransportTests, but this one tests more things, so I wasn't comfortable in doing so.

Another way to avoid using the global in the test, would be to change the assert to check that the key is set with a non-empty value, but don't assert on the value itself.

Copy link
Member

Choose a reason for hiding this comment

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

If we're just going to use the global here, may as well use it in the ContainerTaggingTests too I guess, and not bother deleting that? That said, you have a unit test, which is just as good so meh 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's still nice to be able to get rid of an itest in favor of a utest, independently of this all

@vandonr vandonr requested review from a team as code owners December 17, 2025 16:28
@vandonr
Copy link
Contributor Author

vandonr commented Dec 17, 2025

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

public string? EntityId { get; }
}

internal static class ContainerMetadataHelper
Copy link
Member

Choose a reason for hiding this comment

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

nit: prob should just move this to its own class

};

if (ContainerMetadata.GetContainerId() is { } containerId)
if (ContainerMetadata.Instance.ContainerId is { } containerId)
Copy link
Member

Choose a reason for hiding this comment

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

If we're just going to use the global here, may as well use it in the ContainerTaggingTests too I guess, and not bother deleting that? That said, you have a unit test, which is just as good so meh 🤷‍♂️

[CombinatorialValues(null, "my-entity-id")]
string entityId)
{
var responseMock = new Mock<IApiResponse>();
Copy link
Member

Choose a reason for hiding this comment

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

Just FYI, we have TestApiRequest and TestApiResponse which are much easier to work with than Moq IMO. The Moq in here predates those. No need to have to change, just an FYI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooooh ok, I just took inspiration from the other tests in the same class ^^

@vandonr vandonr enabled auto-merge (squash) December 31, 2025 13:57
@vandonr vandonr merged commit fd967a0 into master Jan 5, 2026
150 of 151 checks passed
@vandonr vandonr deleted the vandonr/refacto branch January 5, 2026 09:18
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 5, 2026
@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:refactor labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants