Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include extra tags in error logs #6364

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andrewlock
Copy link
Member

Summary of changes

Includes details about products enabled in the telemetry error logs

Reason for change

Should make it easier to categorize errors knowing e.g. whether the error came from a ci-vis app etc.

Implementation details

The tags are written to every log message, so we need to keep the tags small as possible. I limited it to just 5 tags for now:

  • ci - is CI Visibility enabled
  • asm - is ASM enabled
  • prof - is profiling enabled
  • dyn - is dynamic instrumentation enabled
  • gcp/aws/aas/azf` - are we running in GCP/lambda/AAS/Azure functions (with mini agent)

I think those cover the broadest categories for now. I opted for adding the enabled tag with a 1/0 so we could explicitly see whether it was set or not (apart from the cloud functions which are only added when they apply).

Alternatively, we could only add the tag if it's enabled (like I do for the "cloud" tag). That saves bytes, at the expense of some ambiguity: if the tags aren't there does that mean they definitely were none enabled, or the tagging didn't happen? Happy to switch though if people have a preference.

Test coverage

Unit tests. Will do a manual test to make sure there's no issues with the intake accepting them.

Other details

We currently weren't explicitly recording whether CI Vis was enabled, so I added a method to call to "record" the settings. This isn't really required given we can only get the enabled flag via a static property, but it potentially sets us up a bit more cleanly for refactoring later, and is closer to how other products work. I'm happy to be persuaded to remove that commit though

Technically a no-op, because ci vis currently records them directly in the global config, but follows the existing pattern and sets us up.

I considered just adding it to the `TelemetryProductType` - but it's not a valid option in telemetry intake so thought we better not.
@andrewlock
Copy link
Member Author

andrewlock commented Nov 27, 2024

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (70ms)  : 64, 76
     .   : milestone, 70,
    master - mean (69ms)  : 65, 74
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (1,023ms)  : 935, 1112
     .   : milestone, 1023,
    master - mean (976ms)  : 953, 999
     .   : milestone, 976,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (118ms)  : 110, 126
     .   : milestone, 118,
    master - mean (108ms)  : 106, 110
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (701ms)  : 666, 736
     .   : milestone, 701,
    master - mean (678ms)  : 659, 697
     .   : milestone, 678,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (97ms)  : 93, 101
     .   : milestone, 97,
    master - mean (92ms)  : 89, 94
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (654ms)  : 632, 677
     .   : milestone, 654,
    master - mean (633ms)  : 614, 651
     .   : milestone, 633,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (190ms)  : 186, 194
     .   : milestone, 190,
    master - mean (190ms)  : 186, 194
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (1,101ms)  : 1071, 1131
     .   : milestone, 1101,
    master - mean (1,092ms)  : 1068, 1116
     .   : milestone, 1092,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (276ms)  : 272, 280
     .   : milestone, 276,
    master - mean (276ms)  : 272, 280
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (870ms)  : 840, 900
     .   : milestone, 870,
    master - mean (870ms)  : 835, 905
     .   : milestone, 870,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6364) - mean (265ms)  : 262, 269
     .   : milestone, 265,
    master - mean (265ms)  : 261, 269
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (6364) - mean (844ms)  : 812, 875
     .   : milestone, 844,
    master - mean (850ms)  : 811, 888
     .   : milestone, 850,

Loading

@andrewlock
Copy link
Member Author

andrewlock commented Nov 27, 2024

Throughput/Crank Report ⚡

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6364) (11.237M)   : 0, 11237278
    master (10.997M)   : 0, 10996550
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6364) (7.348M)   : 0, 7347722
    master (7.185M)   : 0, 7184511
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.538M)   : 0, 7538247

    section Manual
    master (11.069M)   : 0, 11069430

    section Manual + Automatic
    This PR (6364) (6.835M)   : 0, 6834721
    master (6.738M)   : 0, 6737616

    section DD_TRACE_ENABLED=0
    master (10.302M)   : 0, 10301778

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6364) (9.401M)   : 0, 9400857
    master (9.415M)   : 0, 9414535
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6364) (6.196M)   : 0, 6196154
    master (6.358M)   : 0, 6358468

    section Trace stats
    master (6.815M)   : 0, 6815014

    section Manual
    master (9.493M)   : 0, 9493123

    section Manual + Automatic
    This PR (6364) (5.980M)   : 0, 5979606
    master (5.926M)   : 0, 5926110

    section DD_TRACE_ENABLED=0
    master (8.735M)   : 0, 8735109

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6364) (8.832M)   : 0, 8831630
    master (10.430M)   : 0, 10430317
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6364) (5.853M)   : crit ,0, 5852892
    master (6.844M)   : 0, 6843537
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (7.470M)   : 0, 7470195

    section Manual
    master (10.484M)   : 0, 10483521

    section Manual + Automatic
    This PR (6364) (5.466M)   : crit ,0, 5465643
    master (6.451M)   : 0, 6451333

    section DD_TRACE_ENABLED=0
    master (9.895M)   : 0, 9894875

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 27, 2024

Datadog Report

Branch report: andrew/include-extra-tags-in-error-logs
Commit report: f93f949
Test service: dd-trace-dotnet

✅ 0 Failed, 454162 Passed, 2732 Skipped, 19h 13m 25s Total Time

@andrewlock
Copy link
Member Author

andrewlock commented Nov 27, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6364 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.184
  • 1 benchmarks are slower, with geometric mean 1.149
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.12μs 45.7ns 320ns 0.017 0.00848 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.2μs 56.3ns 338ns 0.0206 0.0103 0 5.8 KB
master StartStopWithChild net472 16.5μs 72.6ns 281ns 1.04 0.306 0.0909 6.21 KB
#6364 StartStopWithChild net6.0 8.16μs 45.8ns 297ns 0.0117 0.00391 0 5.61 KB
#6364 StartStopWithChild netcoreapp3.1 10.2μs 56.3ns 347ns 0.0287 0.0144 0.00479 5.8 KB
#6364 StartStopWithChild net472 16.3μs 44.2ns 165ns 1.05 0.326 0.0977 6.21 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 508μs 183ns 708ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 433ns 1.68μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 858μs 422ns 1.58μs 0.428 0 0 3.3 KB
#6364 WriteAndFlushEnrichedTraces net6.0 493μs 504ns 1.95μs 0 0 0 2.7 KB
#6364 WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 367ns 1.42μs 0 0 0 2.7 KB
#6364 WriteAndFlushEnrichedTraces net472 854μs 516ns 2μs 0.425 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 151μs 816ns 7.11μs 0.141 0 0 14.47 KB
master SendRequest netcoreapp3.1 162μs 912ns 6.38μs 0.159 0 0 17.27 KB
master SendRequest net472 0.00151ns 0.000677ns 0.00262ns 0 0 0 0 b
#6364 SendRequest net6.0 150μs 857ns 8μs 0.139 0 0 14.47 KB
#6364 SendRequest netcoreapp3.1 170μs 978ns 7.64μs 0.17 0 0 17.27 KB
#6364 SendRequest net472 0.00144ns 0.000643ns 0.00249ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 608μs 4.78μs 45.8μs 0.556 0 0 41.76 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 678μs 2.28μs 7.91μs 0.347 0 0 41.73 KB
master WriteAndFlushEnrichedTraces net472 861μs 3.66μs 13.7μs 8.45 2.53 0.422 53.35 KB
#6364 WriteAndFlushEnrichedTraces net6.0 585μs 2.83μs 12.4μs 0.584 0 0 41.71 KB
#6364 WriteAndFlushEnrichedTraces netcoreapp3.1 683μs 3.16μs 12.6μs 0.34 0 0 41.66 KB
#6364 WriteAndFlushEnrichedTraces net472 872μs 4.11μs 15.4μs 8.13 2.57 0.428 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.29μs 1.22ns 4.72ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.77μs 2.85ns 11ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.13μs 2.31ns 8.64ns 0.157 0.00106 0 987 B
#6364 ExecuteNonQuery net6.0 1.29μs 1.06ns 4.11ns 0.0142 0 0 1.02 KB
#6364 ExecuteNonQuery netcoreapp3.1 1.79μs 1.31ns 4.72ns 0.0133 0 0 1.02 KB
#6364 ExecuteNonQuery net472 2.07μs 1.48ns 5.72ns 0.156 0.00103 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.2μs 0.713ns 2.76ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.62μs 0.522ns 1.88ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.66μs 2.37ns 9.17ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.35μs 0.321ns 1.24ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.66μs 1.43ns 5.55ns 0.0134 0 0 1.02 KB
master CallElasticsearchAsync net472 2.62μs 1.21ns 4.68ns 0.166 0 0 1.05 KB
#6364 CallElasticsearch net6.0 1.22μs 3.26ns 12.6ns 0.0134 0 0 976 B
#6364 CallElasticsearch netcoreapp3.1 1.54μs 0.483ns 1.67ns 0.013 0 0 976 B
#6364 CallElasticsearch net472 2.56μs 2.56ns 9.91ns 0.157 0 0 995 B
#6364 CallElasticsearchAsync net6.0 1.27μs 0.436ns 1.63ns 0.0133 0 0 952 B
#6364 CallElasticsearchAsync netcoreapp3.1 1.62μs 0.679ns 2.54ns 0.0139 0 0 1.02 KB
#6364 CallElasticsearchAsync net472 2.61μs 1.79ns 6.93ns 0.167 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.19μs 0.582ns 2.18ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.59μs 1.3ns 4.85ns 0.0126 0 0 952 B
master ExecuteAsync net472 1.81μs 0.76ns 2.94ns 0.145 0 0 915 B
#6364 ExecuteAsync net6.0 1.27μs 0.513ns 1.85ns 0.0133 0 0 952 B
#6364 ExecuteAsync netcoreapp3.1 1.59μs 0.917ns 3.55ns 0.0127 0 0 952 B
#6364 ExecuteAsync net472 1.76μs 0.592ns 2.29ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.45μs 1.5ns 5.8ns 0.0311 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.18μs 2.63ns 10.2ns 0.0389 0 0 2.85 KB
master SendAsync net472 7.16μs 1.74ns 6.72ns 0.494 0 0 3.12 KB
#6364 SendAsync net6.0 4.39μs 4.42ns 17.1ns 0.033 0 0 2.31 KB
#6364 SendAsync netcoreapp3.1 5.3μs 2.37ns 9.18ns 0.0372 0 0 2.85 KB
#6364 SendAsync net472 7.32μs 2.33ns 9.04ns 0.493 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.45μs 1.41ns 5.27ns 0.0226 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.3μs 1.52ns 5.68ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.62μs 1.04ns 4.01ns 0.249 0 0 1.57 KB
#6364 EnrichedLog net6.0 1.5μs 0.576ns 2.23ns 0.0225 0 0 1.64 KB
#6364 EnrichedLog netcoreapp3.1 2.11μs 0.76ns 2.84ns 0.0222 0 0 1.64 KB
#6364 EnrichedLog net472 2.52μs 2.42ns 9.36ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 120μs 235ns 911ns 0.061 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 124μs 145ns 560ns 0 0 0 4.28 KB
master EnrichedLog net472 152μs 138ns 534ns 0.684 0.228 0 4.46 KB
#6364 EnrichedLog net6.0 119μs 174ns 652ns 0.0601 0 0 4.28 KB
#6364 EnrichedLog netcoreapp3.1 123μs 305ns 1.1μs 0 0 0 4.28 KB
#6364 EnrichedLog net472 152μs 121ns 469ns 0.68 0.227 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.02μs 1.19ns 4.59ns 0.0303 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.04μs 1.3ns 4.86ns 0.0303 0 0 2.2 KB
master EnrichedLog net472 4.89μs 1.19ns 4.44ns 0.321 0 0 2.02 KB
#6364 EnrichedLog net6.0 2.97μs 1.39ns 5.39ns 0.031 0 0 2.2 KB
#6364 EnrichedLog netcoreapp3.1 4.21μs 1.53ns 5.91ns 0.0295 0 0 2.2 KB
#6364 EnrichedLog net472 4.86μs 3.67ns 14.2ns 0.319 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.33μs 0.984ns 3.81ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 1.08ns 4.19ns 0.0152 0 0 1.14 KB
master SendReceive net472 2.1μs 1.01ns 3.78ns 0.183 0 0 1.16 KB
#6364 SendReceive net6.0 1.35μs 0.975ns 3.38ns 0.0163 0 0 1.14 KB
#6364 SendReceive netcoreapp3.1 1.82μs 0.83ns 3.22ns 0.0153 0 0 1.14 KB
#6364 SendReceive net472 2.03μs 1.45ns 5.6ns 0.183 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.66μs 0.937ns 3.51ns 0.0215 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.98μs 2.76ns 10.7ns 0.0219 0 0 1.65 KB
master EnrichedLog net472 4.55μs 2.45ns 9.51ns 0.323 0 0 2.04 KB
#6364 EnrichedLog net6.0 2.68μs 0.558ns 2.09ns 0.0227 0 0 1.6 KB
#6364 EnrichedLog netcoreapp3.1 3.98μs 3.11ns 12ns 0.0218 0 0 1.65 KB
#6364 EnrichedLog net472 4.52μs 2.83ns 10.2ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 405ns 0.288ns 1.11ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 656ns 0.217ns 0.813ns 0.00764 0 0 576 B
master StartFinishSpan net472 639ns 0.675ns 2.62ns 0.0916 0 0 578 B
master StartFinishScope net6.0 484ns 0.247ns 0.925ns 0.00971 0 0 696 B
master StartFinishScope netcoreapp3.1 758ns 0.341ns 1.28ns 0.00944 0 0 696 B
master StartFinishScope net472 895ns 0.456ns 1.77ns 0.104 0 0 658 B
#6364 StartFinishSpan net6.0 422ns 0.157ns 0.588ns 0.00809 0 0 576 B
#6364 StartFinishSpan netcoreapp3.1 591ns 0.302ns 1.17ns 0.00794 0 0 576 B
#6364 StartFinishSpan net472 676ns 0.57ns 2.13ns 0.0916 0 0 578 B
#6364 StartFinishScope net6.0 479ns 0.388ns 1.5ns 0.00972 0 0 696 B
#6364 StartFinishScope netcoreapp3.1 815ns 0.476ns 1.71ns 0.00901 0 0 696 B
#6364 StartFinishScope net472 881ns 0.576ns 2.23ns 0.105 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6364

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 1.149 1,047.84 1,203.67

Faster 🎉 in #6364

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.184 1,002.50 846.99

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 646ns 0.517ns 1.93ns 0.00975 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1μs 0.992ns 3.84ns 0.00904 0 0 696 B
master RunOnMethodBegin net472 1.05μs 0.503ns 1.95ns 0.104 0 0 658 B
#6364 RunOnMethodBegin net6.0 613ns 0.211ns 0.817ns 0.00988 0 0 696 B
#6364 RunOnMethodBegin netcoreapp3.1 847ns 1.08ns 4.16ns 0.00929 0 0 696 B
#6364 RunOnMethodBegin net472 1.2μs 0.427ns 1.65ns 0.104 0 0 658 B

@andrewlock andrewlock marked this pull request as ready for review November 27, 2024 17:29
@andrewlock andrewlock requested review from a team as code owners November 27, 2024 17:29
Copy link
Collaborator

@pierotibou pierotibou left a comment

Choose a reason for hiding this comment

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

Really nice. We should do this in all languages.
Also do you need to allow list the tags somewhere (as we do for metrics) or are they automatically forwarded to the logs in the end?

Last, I think a good follow up would be to have all logs contain a product prefix, we could enforce it. Cause here, you solve the ci use case easily, but for ASM you still need an extra search to route to them.

{ IsRunningInGCPFunctions: true } => ",gcp",
{ LambdaMetadata.IsRunningInLambda: true } => ",aws",
{ IsRunningMiniAgentInAzureFunctions: true } => ",azf",
{ IsRunningInAzureAppService: true } => ",aas",
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIRC correctly, we don't have that info in telemetry config, and I think it would be awesome. Actually it would be even better in metrics.

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC correctly, we don't have that info in telemetry config

I think we do actually 🤔 It's sent at a higher level via a header or something like that I believe... we also record the settings we use to determine that in telemetry config, but whether other languages do I wouldn't like to say...

@andrewlock
Copy link
Member Author

Also do you need to allow list the tags somewhere (as we do for metrics) or are they automatically forwarded to the logs in the end?

I don't believe so. AFAICT (looking at the telemetry intake code) they're added directly to the destination logs (merged with standard tags)

Last, I think a good follow up would be to have all logs contain a product prefix, we could enforce it. Cause here, you solve the ci use case easily, but for ASM you still need an extra search to route to them.

The problem with this is that many logs won't be one product or another. or it'll be obvious anyway, because they're in the ASM namespace. Also, that will break all existing error tracking... but yeah, we could do it for the obvious ones 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants