Skip to content

[Profiler] Ensure valid json format for information json#8578

Merged
chrisnas merged 2 commits into
masterfrom
chrisnas/fix_env_vars_json
May 7, 2026
Merged

[Profiler] Ensure valid json format for information json#8578
chrisnas merged 2 commits into
masterfrom
chrisnas/fix_env_vars_json

Conversation

@chrisnas

@chrisnas chrisnas commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Fix possible invalid Json generation

Reason for change

Invalid Json would fail the profile sending

Implementation details

Handle empty cases

Test coverage

New tests have been added

Other details

@chrisnas
chrisnas requested a review from a team as a code owner May 7, 2026 09:17
@github-actions github-actions Bot added the area:profiler Issues related to the continous-profiler label May 7, 2026
@pr-commenter

pr-commenter Bot commented May 7, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-07 10:23:08

Comparing candidate commit 502d112 in PR branch chrisnas/fix_env_vars_json with baseline commit 3825f10 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 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 ----------------------------------'

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 [-8818.319op/s; -8417.729op/s] or [-10.456%; -9.981%]

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

  • 🟥 throughput [-6676.545op/s; -5489.003op/s] or [-6.789%; -5.581%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+310.757ms; +315.956ms] or [+154.208%; +156.789%]
  • 🟥 throughput [-44.982op/s; -41.264op/s] or [-8.093%; -7.424%]

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

  • 🟥 execution_time [+380.573ms; +382.911ms] or [+300.676%; +302.523%]
  • 🟩 throughput [+92.146op/s; +97.167op/s] or [+12.149%; +12.811%]

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

  • 🟥 execution_time [+391.435ms; +393.766ms] or [+346.405%; +348.468%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.575ms; -11.391ms] or [-7.274%; -5.320%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-266798.785op/s; -262645.476op/s] or [-27.241%; -26.817%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.937ms; -22.079ms] or [-12.013%; -9.846%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-144998.057op/s; -128549.294op/s] or [-20.833%; -18.470%]

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

  • 🟩 throughput [+9420.766op/s; +12331.890op/s] or [+5.994%; +7.847%]

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

  • 🟩 throughput [+8858.815op/s; +11526.014op/s] or [+7.057%; +9.182%]

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

  • 🟩 throughput [+451485.940op/s; +466473.760op/s] or [+15.054%; +15.554%]

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

  • 🟩 execution_time [-18.670ms; -14.279ms] or [-8.606%; -6.582%]
  • 🟩 throughput [+198205.435op/s; +252184.265op/s] or [+7.867%; +10.010%]

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

  • 🟥 execution_time [+299.306ms; +299.831ms] or [+149.553%; +149.816%]

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

  • 🟥 execution_time [+298.623ms; +301.852ms] or [+150.596%; +152.225%]

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

  • 🟥 execution_time [+299.788ms; +302.286ms] or [+151.010%; +152.268%]

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

  • 🟥 execution_time [+296.718ms; +297.488ms] or [+145.736%; +146.114%]

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

  • 🟥 execution_time [+296.767ms; +299.747ms] or [+145.079%; +146.535%]

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

  • 🟥 execution_time [+301.314ms; +302.784ms] or [+150.597%; +151.331%]

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

  • 🟥 execution_time [+20.095µs; +43.644µs] or [+6.415%; +13.933%]
  • 🟥 throughput [-409.083op/s; -210.881op/s] or [-12.752%; -6.574%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.903ms; +300.608ms] or [+149.682%; +150.034%]

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

  • unstable execution_time [+371.838ms; +405.095ms] or [+404.017%; +440.152%]
  • 🟩 throughput [+998.895op/s; +1136.501op/s] or [+8.208%; +9.339%]

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

  • unstable execution_time [+334.090ms; +362.454ms] or [+253.672%; +275.208%]
  • 🟩 throughput [+739.137op/s; +935.058op/s] or [+7.155%; +9.052%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+2.823KB; +2.828KB] or [+5.016%; +5.024%]
  • unstable execution_time [+256.193ms; +297.500ms] or [+117.795%; +136.787%]
  • 🟥 throughput [-523.642op/s; -486.951op/s] or [-47.447%; -44.123%]

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

  • unstable execution_time [+202.775ms; +336.001ms] or [+86.414%; +143.190%]
  • 🟥 throughput [-668.043op/s; -584.615op/s] or [-44.559%; -38.994%]

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

  • 🟥 allocated_mem [+2.304KB; +2.308KB] or [+5.441%; +5.449%]
  • 🟥 execution_time [+335.851ms; +344.374ms] or [+200.878%; +205.976%]
  • 🟥 throughput [-419.379op/s; -383.729op/s] or [-29.201%; -26.718%]

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

  • 🟩 execution_time [-168.121µs; -127.030µs] or [-8.516%; -6.435%]
  • 🟩 throughput [+37.043op/s; +47.957op/s] or [+7.313%; +9.467%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.308ms; +305.397ms] or [+152.740%; +153.792%]

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

  • 🟥 execution_time [+303.896ms; +305.613ms] or [+152.283%; +153.143%]

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

  • 🟥 execution_time [+300.973ms; +303.972ms] or [+151.196%; +152.703%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+305.018ms; +306.444ms] or [+153.170%; +153.886%]

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

  • 🟥 execution_time [+296.997ms; +298.931ms] or [+146.852%; +147.808%]

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

  • 🟥 execution_time [+303.841ms; +307.387ms] or [+154.000%; +155.797%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+303.469ms; +305.561ms] or [+152.314%; +153.364%]

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

  • 🟥 execution_time [+298.088ms; +300.187ms] or [+148.570%; +149.616%]
  • 🟩 throughput [+55839.722op/s; +60870.719op/s] or [+11.088%; +12.087%]

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

  • 🟥 execution_time [+299.068ms; +301.903ms] or [+148.784%; +150.194%]

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

  • 🟩 execution_time [-16.686ms; -13.036ms] or [-7.759%; -6.062%]

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

  • unstable execution_time [+7.884µs; +49.127µs] or [+1.947%; +12.135%]

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

  • 🟥 allocated_mem [+35.239KB; +35.261KB] or [+12.854%; +12.863%]
  • unstable execution_time [+5.786µs; +77.154µs] or [+1.144%; +15.249%]
  • unstable throughput [-199.455op/s; +12.855op/s] or [-9.953%; +0.641%]

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

  • 🟩 allocated_mem [-18.070KB; -18.054KB] or [-6.588%; -6.582%]

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

  • unstable execution_time [+5.774µs; +10.033µs] or [+13.648%; +23.714%]
  • 🟥 throughput [-4483.637op/s; -2677.875op/s] or [-18.875%; -11.273%]

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

  • unstable execution_time [-13.365µs; -5.993µs] or [-20.735%; -9.299%]
  • 🟩 throughput [+1550.807op/s; +3118.332op/s] or [+9.515%; +19.132%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.499ms; +305.172ms] or [+153.405%; +154.251%]

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

  • 🟥 execution_time [+303.603ms; +306.414ms] or [+154.533%; +155.964%]

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

  • 🟥 execution_time [+299.999ms; +302.490ms] or [+150.187%; +151.434%]

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

  • 🟩 throughput [+30928.468op/s; +33953.705op/s] or [+5.854%; +6.427%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.651ms; +302.259ms] or [+149.848%; +150.649%]

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

  • 🟥 execution_time [+301.076ms; +302.261ms] or [+151.186%; +151.781%]

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

  • 🟥 execution_time [+303.595ms; +306.267ms] or [+153.964%; +155.319%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.686ms; +301.397ms] or [+149.984%; +150.338%]
  • 🟩 throughput [+51565906.107op/s; +58779052.438op/s] or [+37.553%; +42.807%]

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

  • 🟥 execution_time [+420.138ms; +424.610ms] or [+522.517%; +528.078%]
  • 🟩 throughput [+911.356op/s; +1076.666op/s] or [+7.045%; +8.323%]

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

  • 🟥 execution_time [+299.281ms; +300.212ms] or [+149.275%; +149.739%]

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

  • 🟩 throughput [+61210.848op/s; +72889.662op/s] or [+5.715%; +6.805%]

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

  • 🟩 throughput [+56299.400op/s; +75430.456op/s] or [+6.517%; +8.731%]

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

  • 🟩 throughput [+84859.773op/s; +93461.726op/s] or [+8.428%; +9.282%]

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

  • 🟩 throughput [+43413.583op/s; +49016.823op/s] or [+7.883%; +8.901%]

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

  • 🟩 throughput [+28041.925op/s; +37807.439op/s] or [+6.277%; +8.463%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+90429.949op/s; +107851.905op/s] or [+10.103%; +12.050%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • 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.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@gleocadie gleocadie 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.

LGTM

@chrisnas
chrisnas merged commit 6d9882f into master May 7, 2026
146 checks passed
@chrisnas
chrisnas deleted the chrisnas/fix_env_vars_json branch May 7, 2026 13:49
@github-actions github-actions Bot added this to the vNext-v3 milestone May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:profiler Issues related to the continous-profiler type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants