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

Add ability to disable ActivitySources from being listened to #5795

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

Conversation

bouwkast
Copy link
Contributor

@bouwkast bouwkast commented Jul 19, 2024

Summary of changes

This adds the ability for ActivitySources to be disabled so that they won't be listened to by the .NET Tracer.

Reason for change

Currently there is no way to disable an ActivitySource if OpenTelemetry is enabled in the .NET Tracer without entirely disabling OpenTelemetry support. The IgnoreActivityHandler is insufficient as it will still listen to the ActivitySource so they will create Activity objects.

Implementation details

  • Adds DD_TRACE_DISABLED_ACTIVITY_SOURCES that accepts a comma-separated list of ActivitySource names that supports the glob-pattern.
    • example: "DD_TRACE_DISABLED_ACTIVITY_SOURCES": "SomeSourceName,*SomeGlobPattern*"
  • Adds DisableActivityHandler that will determine based on the above environment variable whether or not a given ActivitySource should be listened to.

Test coverage

  • Updated the NetActivitySdk sample project with an ignored ActivitySource and some that are disabled.

Other details

When merged, get this merged: https://github.com/DataDog/dd-go/pull/148984

Fixes #5740

@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Jul 19, 2024
@andrewlock
Copy link
Member

andrewlock commented Jul 19, 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 (5795) - mean (70ms)  : 68, 72
     .   : milestone, 70,
    master - mean (70ms)  : 68, 73
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (1,088ms)  : 1054, 1121
     .   : milestone, 1088,
    master - mean (1,085ms)  : 1060, 1110
     .   : milestone, 1085,

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

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (762ms)  : 740, 784
     .   : milestone, 762,
    master - mean (766ms)  : 739, 792
     .   : milestone, 766,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5795) - mean (93ms)  : 90, 96
     .   : milestone, 93,
    master - mean (93ms)  : 88, 98
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (719ms)  : 689, 749
     .   : milestone, 719,
    master - mean (714ms)  : 697, 731
     .   : milestone, 714,

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

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (1,159ms)  : 1130, 1188
     .   : milestone, 1159,
    master - mean (1,157ms)  : 1133, 1181
     .   : milestone, 1157,

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

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (917ms)  : 893, 942
     .   : milestone, 917,
    master - mean (917ms)  : 900, 934
     .   : milestone, 917,

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

    section CallTarget+Inlining+NGEN
    This PR (5795) - mean (906ms)  : 883, 929
     .   : milestone, 906,
    master - mean (906ms)  : 882, 931
     .   : milestone, 906,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jul 19, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5795 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.128
  • 1 benchmarks have more 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 7.91μs 44.4ns 288ns 0.0118 0.0079 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10.2μs 53.4ns 297ns 0.0148 0.00494 0 5.62 KB
master StartStopWithChild net472 15.6μs 35.8ns 129ns 1 0.29 0.094 6.06 KB
#5795 StartStopWithChild net6.0 7.75μs 44.3ns 316ns 0.0148 0.00739 0 5.42 KB
#5795 StartStopWithChild netcoreapp3.1 9.6μs 50.9ns 249ns 0.019 0.00474 0 5.62 KB
#5795 StartStopWithChild net472 16μs 46.4ns 180ns 1.01 0.297 0.0882 6.06 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 483μs 442ns 1.71μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 665μs 190ns 737ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 850μs 394ns 1.37μs 0.425 0 0 3.3 KB
#5795 WriteAndFlushEnrichedTraces net6.0 486μs 185ns 715ns 0 0 0 2.7 KB
#5795 WriteAndFlushEnrichedTraces netcoreapp3.1 634μs 317ns 1.19μs 0 0 0 2.7 KB
#5795 WriteAndFlushEnrichedTraces net472 846μs 1.13μs 4.08μs 0.417 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 203μs 1.1μs 6.71μs 0.193 0 0 18.45 KB
master SendRequest netcoreapp3.1 221μs 1.21μs 7.25μs 0.224 0 0 20.61 KB
master SendRequest net472 0.000758ns 0.000485ns 0.00182ns 0 0 0 0 b
#5795 SendRequest net6.0 200μs 1.14μs 8.25μs 0.204 0 0 18.45 KB
#5795 SendRequest netcoreapp3.1 224μs 1.25μs 8.57μs 0.237 0 0 20.61 KB
#5795 SendRequest net472 0.000801ns 0.000346ns 0.00134ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #5795

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.54 KB 41.86 KB 319 B 0.77%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 565μs 3.05μs 16.7μs 0.553 0 0 41.55 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 695μs 3.59μs 16.8μs 0.357 0 0 41.54 KB
master WriteAndFlushEnrichedTraces net472 865μs 4.14μs 16.6μs 8.36 2.64 0.44 53.29 KB
#5795 WriteAndFlushEnrichedTraces net6.0 570μs 2.58μs 9.99μs 0.573 0 0 41.66 KB
#5795 WriteAndFlushEnrichedTraces netcoreapp3.1 693μs 3.29μs 15.1μs 0.343 0 0 41.86 KB
#5795 WriteAndFlushEnrichedTraces net472 864μs 4.25μs 18.5μs 8.04 2.23 0.446 53.35 KB
Benchmarks.Trace.DbCommandBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5795

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.128 1,336.81 1,185.61

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.34μs 1.94ns 7.51ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.8μs 1.72ns 6.45ns 0.0135 0 0 1.02 KB
master ExecuteNonQuery net472 2.09μs 1.64ns 6.15ns 0.157 0 0 987 B
#5795 ExecuteNonQuery net6.0 1.19μs 1.38ns 5.36ns 0.0143 0 0 1.02 KB
#5795 ExecuteNonQuery netcoreapp3.1 1.78μs 1.27ns 4.91ns 0.0143 0 0 1.02 KB
#5795 ExecuteNonQuery net472 2.08μs 1.95ns 7.55ns 0.157 0 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.19μs 0.97ns 3.63ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.46μs 0.64ns 2.4ns 0.0133 0 0 976 B
master CallElasticsearch net472 2.54μs 1.26ns 4.73ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.24μs 0.547ns 2.12ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 1.99ns 7.71ns 0.014 0 0 1.02 KB
master CallElasticsearchAsync net472 2.6μs 1.72ns 6.67ns 0.166 0 0 1.05 KB
#5795 CallElasticsearch net6.0 1.32μs 1.25ns 4.83ns 0.0139 0 0 976 B
#5795 CallElasticsearch netcoreapp3.1 1.5μs 0.607ns 2.27ns 0.0126 0 0 976 B
#5795 CallElasticsearch net472 2.4μs 1.32ns 5.1ns 0.158 0 0 995 B
#5795 CallElasticsearchAsync net6.0 1.29μs 0.752ns 2.81ns 0.0136 0 0 952 B
#5795 CallElasticsearchAsync netcoreapp3.1 1.66μs 0.549ns 2.05ns 0.0134 0 0 1.02 KB
#5795 CallElasticsearchAsync net472 2.59μs 1.61ns 6.23ns 0.166 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.32μs 0.822ns 3.07ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.63μs 1.54ns 5.78ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.86μs 1.87ns 7.26ns 0.145 0 0 915 B
#5795 ExecuteAsync net6.0 1.24μs 0.908ns 3.52ns 0.0131 0 0 952 B
#5795 ExecuteAsync netcoreapp3.1 1.64μs 0.706ns 2.73ns 0.0123 0 0 952 B
#5795 ExecuteAsync net472 1.72μs 0.721ns 2.79ns 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.09μs 1.18ns 4.27ns 0.0306 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.05μs 8.97ns 34.7ns 0.0371 0 0 2.76 KB
master SendAsync net472 7.69μs 2.16ns 8.07ns 0.496 0 0 3.15 KB
#5795 SendAsync net6.0 4.07μs 1.87ns 6.76ns 0.0305 0 0 2.22 KB
#5795 SendAsync netcoreapp3.1 5.15μs 2.49ns 9.63ns 0.0359 0 0 2.76 KB
#5795 SendAsync net472 7.76μs 1.56ns 6.03ns 0.497 0 0 3.15 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.49μs 0.619ns 2.32ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.3μs 0.805ns 3.01ns 0.0219 0 0 1.64 KB
master EnrichedLog net472 2.73μs 2.61ns 10.1ns 0.249 0 0 1.57 KB
#5795 EnrichedLog net6.0 1.52μs 3.41ns 13.2ns 0.0228 0 0 1.64 KB
#5795 EnrichedLog netcoreapp3.1 2.21μs 0.944ns 3.53ns 0.0221 0 0 1.64 KB
#5795 EnrichedLog net472 2.74μs 1.59ns 6.17ns 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 116μs 147ns 570ns 0.0576 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 114ns 410ns 0 0 0 4.28 KB
master EnrichedLog net472 149μs 186ns 697ns 0.666 0.222 0 4.46 KB
#5795 EnrichedLog net6.0 116μs 212ns 820ns 0.0586 0 0 4.28 KB
#5795 EnrichedLog netcoreapp3.1 121μs 202ns 781ns 0 0 0 4.28 KB
#5795 EnrichedLog net472 150μs 245ns 949ns 0.674 0.225 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.18μs 2.17ns 8.13ns 0.0308 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.22μs 2.49ns 9.63ns 0.0295 0 0 2.2 KB
master EnrichedLog net472 4.89μs 1.84ns 6.63ns 0.32 0 0 2.02 KB
#5795 EnrichedLog net6.0 3.06μs 1.27ns 4.91ns 0.0307 0 0 2.2 KB
#5795 EnrichedLog netcoreapp3.1 4.13μs 2.66ns 10.3ns 0.0287 0 0 2.2 KB
#5795 EnrichedLog net472 4.8μs 1.24ns 4.8ns 0.321 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.41μs 0.671ns 2.6ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 0.785ns 3.04ns 0.015 0 0 1.14 KB
master SendReceive net472 2.14μs 2.08ns 8.05ns 0.183 0.00107 0 1.16 KB
#5795 SendReceive net6.0 1.48μs 0.948ns 3.67ns 0.0159 0 0 1.14 KB
#5795 SendReceive netcoreapp3.1 1.77μs 0.996ns 3.73ns 0.0151 0 0 1.14 KB
#5795 SendReceive net472 2.18μs 0.731ns 2.74ns 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.91μs 1.19ns 4.63ns 0.0218 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4.01μs 1.49ns 5.78ns 0.0221 0 0 1.65 KB
master EnrichedLog net472 4.35μs 1.98ns 7.66ns 0.322 0 0 2.04 KB
#5795 EnrichedLog net6.0 2.77μs 0.913ns 3.54ns 0.0222 0 0 1.6 KB
#5795 EnrichedLog netcoreapp3.1 3.98μs 1.07ns 4.02ns 0.022 0 0 1.65 KB
#5795 EnrichedLog net472 4.38μs 1.57ns 5.86ns 0.322 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 395ns 0.182ns 0.682ns 0.00816 0 0 576 B
master StartFinishSpan netcoreapp3.1 620ns 0.505ns 1.96ns 0.00782 0 0 576 B
master StartFinishSpan net472 654ns 0.487ns 1.89ns 0.0916 0 0 578 B
master StartFinishScope net6.0 473ns 0.34ns 1.32ns 0.00969 0 0 696 B
master StartFinishScope netcoreapp3.1 698ns 0.385ns 1.49ns 0.00917 0 0 696 B
master StartFinishScope net472 844ns 0.764ns 2.96ns 0.104 0 0 658 B
#5795 StartFinishSpan net6.0 396ns 0.193ns 0.747ns 0.00814 0 0 576 B
#5795 StartFinishSpan netcoreapp3.1 612ns 0.592ns 2.29ns 0.00769 0 0 576 B
#5795 StartFinishSpan net472 694ns 0.863ns 3.34ns 0.0915 0 0 578 B
#5795 StartFinishScope net6.0 492ns 0.312ns 1.21ns 0.00982 0 0 696 B
#5795 StartFinishScope netcoreapp3.1 720ns 0.848ns 3.28ns 0.00934 0 0 696 B
#5795 StartFinishScope net472 809ns 1.56ns 6.03ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5795

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.128 659.39 584.40

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 659ns 0.57ns 2.21ns 0.00957 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 965ns 0.694ns 2.5ns 0.00908 0 0 696 B
master RunOnMethodBegin net472 1.11μs 1.46ns 5.64ns 0.104 0 0 658 B
#5795 RunOnMethodBegin net6.0 584ns 0.504ns 1.95ns 0.00971 0 0 696 B
#5795 RunOnMethodBegin netcoreapp3.1 970ns 0.925ns 3.58ns 0.00917 0 0 696 B
#5795 RunOnMethodBegin net472 1.09μs 0.727ns 2.81ns 0.105 0 0 658 B

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jul 19, 2024

Datadog Report

Branch report: steven/disable-otel-integrations
Commit report: c1eafd0
Test service: dd-trace-dotnet

✅ 0 Failed, 362228 Passed, 2052 Skipped, 15h 7m 32.91s Total Time

@bouwkast bouwkast force-pushed the steven/disable-otel-integrations branch from 87fbe4e to eda5838 Compare August 16, 2024 22:55
@bouwkast bouwkast changed the title Add DisableActivityHandler for disabling ActivitySources Add ability to disable ActivitySources from being listened to Aug 16, 2024
@bouwkast bouwkast force-pushed the steven/disable-otel-integrations branch from eda5838 to df96756 Compare August 16, 2024 23:03
@bouwkast bouwkast marked this pull request as ready for review August 16, 2024 23:05
@bouwkast bouwkast requested a review from a team as a code owner August 16, 2024 23:05
@andrewlock
Copy link
Member

andrewlock commented Aug 17, 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 (5795) (11.135M)   : 0, 11134589
    master (11.279M)   : 0, 11278706

    section Automatic
    This PR (5795) (7.359M)   : 0, 7358616
    master (7.484M)   : 0, 7483556

    section Trace stats
    master (7.777M)   : 0, 7777491

    section Manual
    master (11.174M)   : 0, 11173648

    section Manual + Automatic
    This PR (5795) (6.959M)   : 0, 6958570
    master (6.997M)   : 0, 6996699

    section DD_TRACE_ENABLED=0
    master (10.171M)   : 0, 10170625

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5795) (9.507M)   : 0, 9507330
    master (9.551M)   : 0, 9551364
    benchmarks/2.9.0 (9.645M)   : 0, 9644839

    section Automatic
    This PR (5795) (6.511M)   : 0, 6511216
    master (6.593M)   : 0, 6592751

    section Trace stats
    master (6.918M)   : 0, 6918403

    section Manual
    master (9.647M)   : 0, 9647351

    section Manual + Automatic
    This PR (5795) (6.220M)   : 0, 6219807
    master (6.038M)   : 0, 6037815

    section DD_TRACE_ENABLED=0
    master (9.057M)   : 0, 9056594

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5795) (10.446M)   : 0, 10445973
    master (10.149M)   : 0, 10149156
    benchmarks/2.9.0 (10.408M)   : 0, 10408319

    section Automatic
    This PR (5795) (6.949M)   : 0, 6948799
    master (6.801M)   : 0, 6800902
    benchmarks/2.9.0 (7.412M)   : 0, 7412035

    section Trace stats
    master (7.367M)   : 0, 7366674

    section Manual
    master (9.921M)   : 0, 9920899

    section Manual + Automatic
    This PR (5795) (6.440M)   : 0, 6439716
    master (6.128M)   : 0, 6127561

    section DD_TRACE_ENABLED=0
    master (9.419M)   : 0, 9418987

Loading

/// Default is empty (all ActivitySources will be subscribed to by default).
/// Supports multiple values separated with commas.
/// </summary>
public const string DisabledActivitySources = "DD_DISABLED_ACTIVITY_SOURCES";
Copy link
Member

Choose a reason for hiding this comment

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

We probably want to use the standard DD_TRACE_ prefix here.

(Don't follow DD_DISABLED_INTEGRATIONS above: that's a very old setting from before we had naming conventions. 😅)

Suggested change
public const string DisabledActivitySources = "DD_DISABLED_ACTIVITY_SOURCES";
public const string DisabledActivitySources = "DD_TRACE_DISABLED_ACTIVITY_SOURCES";

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 forget to add this to the configuration telemetry intake's allow-list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/DataDog/dd-go/pull/148984

Thanks! Changed the name and made that PR (draft at the moment)

Sorry, I didn't accept your suggestion, got carried away locally :)

Copy link
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

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

LGTM aside from the setting name.

This allows for users to pass in a comma separated
list of Activity Source names (glob-pattern supported)
that should not be listened to by the Datadog Tracer.
@bouwkast bouwkast force-pushed the steven/disable-otel-integrations branch from df96756 to e958ed5 Compare September 5, 2024 19:08
@lucaspimentel lucaspimentel requested a review from a team September 5, 2024 19:41
Comment on lines +60 to +64
var toDisable = Tracer.Instance.Settings.DisabledActivitySources;
if (toDisable is null || toDisable.Length == 0)
{
return false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't this already covered by the previous checks?

Should be removed

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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to completely disable Npgsql tracing
3 participants