Skip to content

Fix runtime metrics memory_load calculation - #9031

Open
andrewlock wants to merge 3 commits into
andrew/total-processor-count-apifrom
andrew/fix-container-metrics-memory-calculation
Open

Fix runtime metrics memory_load calculation #9031
andrewlock wants to merge 3 commits into
andrew/total-processor-count-apifrom
andrew/fix-container-metrics-memory-calculation

Conversation

@andrewlock

@andrewlock andrewlock commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary of changes

Fixes the runtime metrics value of runtime.dotnet.gc.memory_load in containers

Reason for change

#9015 flagged that the calculation we're currently doing for memory_load is incorrect. This metric is meant to flag essentially how close you are to an OOM. In the "new" implementation (which avoids using event pipes to prevent crashes) we read GC values using GC.GetGCMemoryInfo() which gives some values of interest, e.g.:

  • MemoryLoadBytes - This is the amount of physical memory the process is using (in bytes).
  • TotalAvailableMemoryBytes - This is the amount of physical memory on the machine available for the GC to use. In containers with memory limits, this is set to 75% of the available memory (this is the bug).
  • HighMemoryLoadThresholdBytes - This is the percentage of total physical memory on the machine, being used, at which point the GC becomes more aggressive.

Our previous implementation assumed that TotalAvailableMemoryBytes was... well... the total available memory in bytes, and so we calculated memory_load as a _percentage using (effectively)

var memoryLoadPercentage = (MemoryLoadBytes / TotalAvailableMemoryBytes) * 100;

However, in containers, the value returned by TotalAvailableMemoryBytes is not the total available memory, it's 75% of that, which leads to our memory load calculation being 1/3 too high, and leads to absurdities like memory load being > 100% at high load. That's because MemoryLoadBytes maxes out at the real total available memory (before OOMing); i.e. it's the "real" total memory that matters, not the "fake" 75% limit that is provided in TotalAvailableMemoryBytes.

The real problem is: there's no simple way for us to get the "real" total available memory from the runtime 🙁

Implementation details

I could see essentially two different options:

  • Try to parse the values from the system to find the "real" total available memory, in the same way the GC does.
  • Use HighMemoryLoadThresholdBytes to infer the total memory.

Both have their difficulties, but the second approach is the one I went for, as ultimately there were fewer moving parts. We can calculate the real available memory from HighMemoryLoadThresholdBytes given that

HighMemoryLoadThresholdBytes = RealAvailableMemoryBytes * (HighMemoryThresholdPercent / 100)

Which means we need HighMemoryLoadThresholdBytes and HighMemoryThresholdPercent. We definitely have the first one, but we also need the threshold. This is calculated in the GC in two steps (this hasn't ever changed in .NET Core AFAICT):

Once we have this threshold, we can then obtain RealAvailableMemory using

RealAvailableMemoryBytes = (HighMemoryLoadThresholdBytes * 100.0) / HighMemoryThresholdPercent

and from there we can get the memory load:

MemoryLoadPercentage = (MemoryLoadBytes / RealAvailableMemoryBytes) * 100

# or, substituting

MemoryLoadPercentage = MemoryLoadBytes * HighMemoryThresholdPercent / HighMemoryLoadThresholdBytes

Test coverage

This is kind of tricky, because it naturally relies on how much memory we're using. One way to test is simply set the config - before we would give wildly incorrect values, now we shouldn't. But the container limits issue is harder to test in CI. Instead, I fell back to manually testing locally for that, and showed that it's working as expected now

Other details

Fixes #9015

@andrewlock andrewlock added type:bug area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) runtime:netcore .NET Core area:runtime-metrics identified-by:customer labels Aug 12, 2026
@pr-commenter

pr-commenter Bot commented Aug 12, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-13 10:41:56

Comparing candidate commit 9dbb8eb in PR branch andrew/fix-container-metrics-memory-calculation with baseline commit a8b105f in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 66 known flaky benchmarks, 60 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 [-26720.935op/s; -23584.048op/s] or [-7.526%; -6.642%]

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 [-8904.076op/s; -8399.013op/s] or [-10.558%; -9.959%]

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

  • 🟥 throughput [-11199.283op/s; -9932.374op/s] or [-11.387%; -10.099%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+317.521ms; +321.817ms] or [+157.565%; +159.697%]
  • 🟥 throughput [-42.441op/s; -37.810op/s] or [-7.636%; -6.803%]

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

  • 🟥 execution_time [+375.079ms; +379.368ms] or [+296.335%; +299.724%]
  • 🟩 throughput [+91.210op/s; +94.187op/s] or [+12.026%; +12.418%]

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

  • 🟥 execution_time [+394.251ms; +396.705ms] or [+348.897%; +351.069%]

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

  • 🟥 allocated_mem [+4.693KB; +4.694KB] or [+98.806%; +98.821%]
  • 🟥 throughput [-60340.382op/s; -59987.801op/s] or [-46.948%; -46.674%]

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

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-15.402ms; -11.174ms] or [-7.193%; -5.219%]
  • 🟥 throughput [-59878.731op/s; -57107.656op/s] or [-43.708%; -41.685%]

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

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-49149.019op/s; -46882.359op/s] or [-44.436%; -42.387%]

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

  • 🟥 allocated_mem [+1.315KB; +1.315KB] or [+106.388%; +106.404%]
  • 🟥 throughput [-258927.551op/s; -255344.904op/s] or [-26.438%; -26.072%]

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

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-25.267ms; -20.356ms] or [-11.268%; -9.078%]
  • 🟥 throughput [-75114.629op/s; -51010.972op/s] or [-8.025%; -5.450%]

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

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-162163.672op/s; -145810.004op/s] or [-23.300%; -20.950%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-73168.854op/s; -72383.272op/s] or [-49.242%; -48.713%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-73248.849op/s; -70362.650op/s] or [-46.607%; -44.771%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-55575.646op/s; -52946.786op/s] or [-44.273%; -42.179%]

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

  • 🟩 throughput [+237369.753op/s; +271558.034op/s] or [+7.915%; +9.055%]

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

  • 🟩 execution_time [-19.308ms; -14.966ms] or [-8.900%; -6.899%]

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

  • 🟩 allocated_mem [-13.759KB; -13.756KB] or [-42.324%; -42.316%]
  • 🟥 execution_time [+299.575ms; +300.256ms] or [+149.688%; +150.028%]
  • 🟩 throughput [+1003.454op/s; +1021.160op/s] or [+11.083%; +11.279%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+299.051ms; +313.076ms] or [+150.812%; +157.885%]
  • 🟩 throughput [+2094.825op/s; +2482.855op/s] or [+16.022%; +18.990%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.098ms; +307.529ms] or [+151.166%; +154.909%]
  • 🟩 throughput [+1685.842op/s; +1882.612op/s] or [+16.276%; +18.176%]

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

  • 🟥 execution_time [+295.042ms; +296.614ms] or [+144.913%; +145.685%]
  • 🟩 throughput [+590.390op/s; +605.230op/s] or [+15.651%; +16.045%]

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

  • 🟥 execution_time [+299.204ms; +301.327ms] or [+146.270%; +147.308%]
  • 🟩 throughput [+2703.949op/s; +2773.907op/s] or [+39.283%; +40.300%]

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

  • 🟥 execution_time [+293.398ms; +299.396ms] or [+146.640%; +149.638%]
  • 🟩 throughput [+1136.048op/s; +1317.132op/s] or [+22.550%; +26.144%]

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

  • 🟩 execution_time [-148.064µs; -143.304µs] or [-30.400%; -29.422%]
  • 🟩 throughput [+860.157op/s; +894.389op/s] or [+41.894%; +43.561%]

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

  • 🟩 execution_time [-137.386µs; -110.621µs] or [-31.510%; -25.371%]
  • 🟩 throughput [+843.894op/s; +968.476op/s] or [+36.689%; +42.105%]

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

  • 🟩 execution_time [-142.787µs; -120.825µs] or [-30.593%; -25.887%]
  • 🟩 throughput [+778.631op/s; +860.799op/s] or [+35.943%; +39.736%]

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

  • 🟩 execution_time [-128.077µs; -123.623µs] or [-34.580%; -33.377%]
  • 🟩 throughput [+1364.197op/s; +1418.275op/s] or [+50.524%; +52.526%]

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

  • 🟩 execution_time [-103.369µs; -79.738µs] or [-33.000%; -25.456%]
  • 🟩 throughput [+1202.929op/s; +1406.363op/s] or [+37.499%; +43.840%]

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

  • 🟩 execution_time [-137.744µs; -115.368µs] or [-37.681%; -31.560%]
  • 🟩 throughput [+1330.158op/s; +1466.482op/s] or [+47.734%; +52.626%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.262ms; +300.021ms] or [+149.363%; +149.741%]

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

  • 🟥 execution_time [+413.820ms; +421.783ms] or [+449.632%; +458.285%]
  • 🟩 throughput [+784.853op/s; +930.993op/s] or [+6.449%; +7.650%]

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

  • unstable execution_time [+265.047ms; +320.836ms] or [+201.247%; +243.608%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+297.543ms; +369.179ms] or [+136.808%; +169.745%]
  • 🟥 throughput [-597.173op/s; -532.950op/s] or [-54.110%; -48.290%]

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

  • unstable execution_time [+199.772ms; +333.017ms] or [+85.134%; +141.918%]
  • 🟥 throughput [-672.397op/s; -588.922op/s] or [-44.849%; -39.281%]

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

  • 🟥 execution_time [+327.376ms; +338.783ms] or [+195.809%; +202.632%]
  • 🟥 throughput [-385.419op/s; -349.787op/s] or [-26.836%; -24.355%]

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

  • 🟩 throughput [+47.734op/s; +85.424op/s] or [+5.147%; +9.211%]

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

  • unstable throughput [-15.165op/s; +57.929op/s] or [-2.831%; +10.813%]

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

  • 🟩 execution_time [-163.478µs; -114.979µs] or [-8.281%; -5.824%]
  • 🟩 throughput [+32.528op/s; +46.733op/s] or [+6.421%; +9.225%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.037ms; +305.193ms] or [+152.604%; +153.689%]

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

  • 🟥 execution_time [+299.925ms; +313.318ms] or [+150.293%; +157.004%]

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

  • 🟥 execution_time [+301.661ms; +320.841ms] or [+151.542%; +161.177%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.649ms; +302.775ms] or [+151.478%; +152.044%]

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

  • 🟥 execution_time [+299.676ms; +302.187ms] or [+148.177%; +149.418%]

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

  • 🟥 execution_time [+305.106ms; +308.942ms] or [+154.641%; +156.585%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.176ms; +302.962ms] or [+151.163%; +152.060%]

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

  • 🟥 execution_time [+299.400ms; +301.921ms] or [+149.224%; +150.480%]
  • 🟩 throughput [+48167.312op/s; +54601.868op/s] or [+9.564%; +10.842%]

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

  • 🟥 execution_time [+299.714ms; +302.935ms] or [+149.105%; +150.707%]

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

  • 🟩 execution_time [-15.492ms; -11.487ms] or [-7.204%; -5.341%]
  • 🟩 throughput [+19273.226op/s; +26828.453op/s] or [+5.287%; +7.360%]

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

  • unstable execution_time [+12.850µs; +56.592µs] or [+3.174%; +13.979%]

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

  • 🟩 allocated_mem [-20.357KB; -20.335KB] or [-7.426%; -7.418%]
  • unstable execution_time [-33.892µs; +23.643µs] or [-6.699%; +4.673%]

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

  • 🟩 allocated_mem [-19.702KB; -19.685KB] or [-7.182%; -7.176%]
  • unstable execution_time [-74.055µs; -10.466µs] or [-12.833%; -1.814%]
  • unstable throughput [+54.954op/s; +237.530op/s] or [+3.140%; +13.570%]

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

  • unstable execution_time [+6.762µs; +11.425µs] or [+15.983%; +27.005%]
  • 🟥 throughput [-5057.942op/s; -3151.472op/s] or [-21.292%; -13.267%]

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

  • unstable execution_time [-13.196µs; -4.838µs] or [-20.473%; -7.506%]
  • unstable throughput [+1219.149op/s; +3048.436op/s] or [+7.480%; +18.703%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.161ms; +303.883ms] or [+152.729%; +153.599%]

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

  • 🟥 execution_time [+303.620ms; +306.630ms] or [+154.542%; +156.074%]

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

  • 🟥 execution_time [+301.081ms; +303.290ms] or [+150.728%; +151.834%]

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

  • 🟩 throughput [+37139.570op/s; +40960.416op/s] or [+7.030%; +7.753%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.392ms; +304.682ms] or [+150.715%; +151.856%]

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

  • 🟥 execution_time [+301.789ms; +303.889ms] or [+151.544%; +152.598%]

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

  • 🟥 execution_time [+303.267ms; +306.060ms] or [+153.797%; +155.214%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.452ms; +301.675ms] or [+149.867%; +150.477%]
  • 🟩 throughput [+61341226.813op/s; +61717251.311op/s] or [+44.672%; +44.946%]

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

  • unstable execution_time [+335.079ms; +399.993ms] or [+416.730%; +497.462%]

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

  • 🟥 execution_time [+298.472ms; +299.500ms] or [+148.871%; +149.384%]

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

  • 🟩 throughput [+84835.843op/s; +101483.696op/s] or [+7.921%; +9.475%]

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

  • 🟩 throughput [+70517.742op/s; +103820.317op/s] or [+5.458%; +8.036%]

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

  • 🟩 throughput [+61613.816op/s; +71115.353op/s] or [+6.119%; +7.063%]

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

  • 🟩 throughput [+53737.628op/s; +60509.046op/s] or [+9.758%; +10.987%]

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.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • 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 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

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@andrewlock
andrewlock force-pushed the andrew/fix-container-metrics-memory-calculation branch from d481ab3 to f6f8901 Compare August 12, 2026 12:40
@andrewlock
andrewlock force-pushed the andrew/fix-container-metrics-memory-calculation branch from f6f8901 to d64fcc6 Compare August 12, 2026 13:09
@andrewlock

Copy link
Copy Markdown
Member Author

@codex review

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

ℹ️ About Codex in GitHub

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

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

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

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

Comment thread tracer/src/Datadog.Trace/RuntimeMetrics/GcMemoryLoadCalculator.cs
Comment thread tracer/src/Datadog.Trace/RuntimeMetrics/GcMemoryLoadCalculator.cs Outdated
Comment thread tracer/src/Datadog.Trace/RuntimeMetrics/GcMemoryLoadCalculator.cs
Comment thread tracer/src/Datadog.Trace/RuntimeMetrics/GcMemoryLoadCalculator.cs Outdated
Comment thread tracer/test/Datadog.Trace.Tests/RuntimeMetrics/GcMemoryLoadCalculatorTests.cs Outdated
@andrewlock
andrewlock force-pushed the andrew/fix-container-metrics-memory-calculation branch from d64fcc6 to 9dbb8eb Compare August 13, 2026 09:54
@andrewlock
andrewlock marked this pull request as ready for review August 13, 2026 09:59
@andrewlock
andrewlock requested a review from a team as a code owner August 13, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime-metrics area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:customer runtime:netcore .NET Core type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runtime.dotnet.gc.memory_load is 4/3 too high in containers with a memory limit, and so exceeds 100

1 participant