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

Change unknown_service to DefaultServiceName #5671

Merged
merged 7 commits into from
Jul 11, 2024

Conversation

bouwkast
Copy link
Contributor

@bouwkast bouwkast commented Jun 7, 2024

Summary of changes

This looks for an unknown_service in service.name for Activity/OpenTelemetry spans and if detected will replace that with the value of DefaultServiceName.

Reason for change

OpenTelemetry will use unknown_service:AssemblyName as the default for service.name if there isn't a value for it.
A workaround to this is to have OTEL_SERVICE_NAME set to the same value as DD_ENV, this avoids needing to do that workaround.

Implementation details

Avoid unknown_service https://opentelemetry.io/docs/specs/semconv/resource/#service

Test coverage

Updated the OpenTelemetrySdk tests to replicate this.

Other details

Fixes #5650

@andrewlock
Copy link
Member

andrewlock commented Jun 7, 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 (5671) - mean (73ms)  : 64, 82
     .   : milestone, 73,
    master - mean (73ms)  : 65, 80
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (1,051ms)  : 1031, 1072
     .   : milestone, 1051,
    master - mean (1,044ms)  : 1027, 1062
     .   : milestone, 1044,

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

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (754ms)  : 737, 771
     .   : milestone, 754,
    master - mean (766ms)  : 742, 789
     .   : milestone, 766,

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

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (702ms)  : 684, 721
     .   : milestone, 702,
    master - mean (701ms)  : 677, 725
     .   : milestone, 701,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5671) - mean (195ms)  : 190, 200
     .   : milestone, 195,
    master - mean (196ms)  : 191, 200
     .   : milestone, 196,

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (1,197ms)  : 1162, 1232
     .   : milestone, 1197,
    master - mean (1,188ms)  : 1163, 1213
     .   : milestone, 1188,

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

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (972ms)  : 946, 997
     .   : milestone, 972,
    master - mean (964ms)  : 945, 984
     .   : milestone, 964,

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

    section CallTarget+Inlining+NGEN
    This PR (5671) - mean (961ms)  : 933, 989
     .   : milestone, 961,
    master - mean (954ms)  : 932, 975
     .   : milestone, 954,

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jun 7, 2024

Datadog Report

Branch report: steven/otel-unknown-service-name
Commit report: da5a209
Test service: dd-trace-dotnet

✅ 0 Failed, 334228 Passed, 1672 Skipped, 14h 3m 15s Total Time

@andrewlock
Copy link
Member

andrewlock commented Jun 7, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5671 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.128
  • 1 benchmarks are slower, with geometric mean 1.233
  • 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 7.63μs 41.7ns 254ns 0.0112 0.00373 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10μs 55.1ns 317ns 0.0191 0.00955 0 5.62 KB
master StartStopWithChild net472 16.9μs 65ns 252ns 1.02 0.306 0.0909 6.06 KB
#5671 StartStopWithChild net6.0 7.79μs 44.3ns 310ns 0.0167 0.00837 0 5.43 KB
#5671 StartStopWithChild netcoreapp3.1 10.1μs 55ns 316ns 0.0197 0.00492 0 5.62 KB
#5671 StartStopWithChild net472 16.6μs 73ns 283ns 1.02 0.299 0.0915 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 464μs 216ns 838ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 240ns 931ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 843μs 192ns 693ns 0.419 0 0 3.3 KB
#5671 WriteAndFlushEnrichedTraces net6.0 481μs 321ns 1.2μs 0 0 0 2.7 KB
#5671 WriteAndFlushEnrichedTraces netcoreapp3.1 636μs 192ns 742ns 0 0 0 2.7 KB
#5671 WriteAndFlushEnrichedTraces net472 838μs 256ns 990ns 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 171μs 199ns 772ns 0.171 0 0 18.45 KB
master SendRequest netcoreapp3.1 191μs 339ns 1.31μs 0.191 0 0 20.62 KB
master SendRequest net472 0.000847ns 0.000356ns 0.00138ns 0 0 0 0 b
#5671 SendRequest net6.0 173μs 243ns 942ns 0.259 0 0 18.45 KB
#5671 SendRequest netcoreapp3.1 191μs 329ns 1.27μs 0.191 0 0 20.61 KB
#5671 SendRequest net472 0.000404ns 0.000193ns 0.000722ns 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 550μs 580ns 2.25μs 0.551 0 0 41.62 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 945ns 3.66μs 0.326 0 0 41.69 KB
master WriteAndFlushEnrichedTraces net472 848μs 3.96μs 15.8μs 8.25 2.6 0.434 53.24 KB
#5671 WriteAndFlushEnrichedTraces net6.0 546μs 318ns 1.23μs 0.546 0 0 41.69 KB
#5671 WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 545ns 2.11μs 0.327 0 0 41.63 KB
#5671 WriteAndFlushEnrichedTraces net472 823μs 4μs 16.5μs 8.13 2.57 0.428 53.26 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.26μs 0.501ns 1.81ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.65μs 1.18ns 4.56ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 1.99μs 0.88ns 3.29ns 0.156 0 0 987 B
#5671 ExecuteNonQuery net6.0 1.29μs 0.534ns 2.07ns 0.0142 0 0 1.02 KB
#5671 ExecuteNonQuery netcoreapp3.1 1.69μs 0.86ns 3.33ns 0.0135 0 0 1.02 KB
#5671 ExecuteNonQuery net472 1.98μs 3.04ns 11ns 0.156 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.29μs 0.848ns 3.28ns 0.0133 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.59μs 0.719ns 2.69ns 0.0135 0 0 976 B
master CallElasticsearch net472 2.48μs 1.23ns 4.77ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.26μs 0.774ns 2.79ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.65μs 0.525ns 1.89ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.7μs 1.66ns 6.44ns 0.166 0 0 1.05 KB
#5671 CallElasticsearch net6.0 1.16μs 0.47ns 1.76ns 0.0134 0 0 976 B
#5671 CallElasticsearch netcoreapp3.1 1.62μs 1.45ns 5.22ns 0.0129 0 0 976 B
#5671 CallElasticsearch net472 2.51μs 2.33ns 9.04ns 0.158 0.00125 0 995 B
#5671 CallElasticsearchAsync net6.0 1.24μs 0.573ns 2.14ns 0.0131 0 0 952 B
#5671 CallElasticsearchAsync netcoreapp3.1 1.54μs 0.692ns 2.49ns 0.0137 0 0 1.02 KB
#5671 CallElasticsearchAsync net472 2.6μs 2.29ns 8.57ns 0.167 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5671

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.233 1,176.03 1,450.01

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.18μs 0.793ns 3.07ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.5μs 1.19ns 4.46ns 0.0122 0 0 952 B
master ExecuteAsync net472 1.88μs 1.26ns 4.87ns 0.145 0 0 915 B
#5671 ExecuteAsync net6.0 1.45μs 1.18ns 4.58ns 0.0131 0 0 952 B
#5671 ExecuteAsync netcoreapp3.1 1.61μs 0.776ns 2.9ns 0.013 0 0 952 B
#5671 ExecuteAsync net472 1.86μs 0.657ns 2.54ns 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.21μs 1.11ns 4.15ns 0.0315 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.15μs 3.65ns 14.1ns 0.036 0 0 2.76 KB
master SendAsync net472 7.63μs 2.84ns 11ns 0.497 0 0 3.15 KB
#5671 SendAsync net6.0 4.33μs 13.9ns 53.9ns 0.0298 0 0 2.22 KB
#5671 SendAsync netcoreapp3.1 5.05μs 2.61ns 9.78ns 0.0383 0 0 2.76 KB
#5671 SendAsync net472 7.91μs 1.8ns 6.74ns 0.498 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.52μs 0.674ns 2.61ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.14μs 0.698ns 2.52ns 0.0225 0 0 1.64 KB
master EnrichedLog net472 2.5μs 1.3ns 4.85ns 0.249 0 0 1.57 KB
#5671 EnrichedLog net6.0 1.43μs 0.486ns 1.88ns 0.0229 0 0 1.64 KB
#5671 EnrichedLog netcoreapp3.1 2.1μs 2.02ns 7.56ns 0.0223 0 0 1.64 KB
#5671 EnrichedLog net472 2.53μs 1.73ns 6.72ns 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 117μs 136ns 527ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 102ns 381ns 0.0591 0 0 4.28 KB
master EnrichedLog net472 147μs 204ns 790ns 0.659 0.22 0 4.46 KB
#5671 EnrichedLog net6.0 117μs 119ns 459ns 0.0581 0 0 4.28 KB
#5671 EnrichedLog netcoreapp3.1 119μs 179ns 692ns 0 0 0 4.28 KB
#5671 EnrichedLog net472 149μs 100ns 374ns 0.67 0.223 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 2.98μs 1.31ns 5.08ns 0.0299 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.15μs 1.57ns 6.07ns 0.029 0 0 2.2 KB
master EnrichedLog net472 5.12μs 27.8ns 190ns 0.319 0 0 2.02 KB
#5671 EnrichedLog net6.0 3.08μs 0.903ns 3.38ns 0.0309 0 0 2.2 KB
#5671 EnrichedLog netcoreapp3.1 4.1μs 0.778ns 2.91ns 0.0286 0 0 2.2 KB
#5671 EnrichedLog net472 4.78μs 1.37ns 5.32ns 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.3μs 1.38ns 5.34ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.72μs 0.685ns 2.65ns 0.0155 0 0 1.14 KB
master SendReceive net472 2.1μs 1.28ns 4.95ns 0.183 0.00106 0 1.16 KB
#5671 SendReceive net6.0 1.37μs 0.805ns 3.12ns 0.0158 0 0 1.14 KB
#5671 SendReceive netcoreapp3.1 1.81μs 0.565ns 2.12ns 0.0154 0 0 1.14 KB
#5671 SendReceive net472 2.13μs 1.68ns 6.3ns 0.183 0.00105 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.63μs 0.766ns 2.97ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.74μs 1.14ns 4.42ns 0.0206 0 0 1.65 KB
master EnrichedLog net472 4.45μs 3.34ns 12.9ns 0.323 0 0 2.04 KB
#5671 EnrichedLog net6.0 2.68μs 1.49ns 5.78ns 0.0214 0 0 1.6 KB
#5671 EnrichedLog netcoreapp3.1 3.86μs 3.73ns 14.4ns 0.0211 0 0 1.65 KB
#5671 EnrichedLog net472 4.23μs 2.43ns 9.42ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5671

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 1.128 755.37 669.53

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 400ns 0.0706ns 0.255ns 0.00809 0 0 576 B
master StartFinishSpan netcoreapp3.1 565ns 0.204ns 0.764ns 0.00768 0 0 576 B
master StartFinishSpan net472 644ns 0.451ns 1.75ns 0.0915 0 0 578 B
master StartFinishScope net6.0 528ns 0.169ns 0.656ns 0.00985 0 0 696 B
master StartFinishScope netcoreapp3.1 755ns 0.264ns 0.987ns 0.00948 0 0 696 B
master StartFinishScope net472 851ns 0.457ns 1.77ns 0.105 0 0 658 B
#5671 StartFinishSpan net6.0 396ns 0.0977ns 0.366ns 0.00813 0 0 576 B
#5671 StartFinishSpan netcoreapp3.1 549ns 0.192ns 0.744ns 0.00771 0 0 576 B
#5671 StartFinishSpan net472 706ns 0.763ns 2.96ns 0.0915 0 0 578 B
#5671 StartFinishScope net6.0 478ns 0.141ns 0.526ns 0.00966 0 0 696 B
#5671 StartFinishScope netcoreapp3.1 670ns 0.241ns 0.868ns 0.00941 0 0 696 B
#5671 StartFinishScope net472 843ns 0.761ns 2.95ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 645ns 0.145ns 0.563ns 0.00968 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 979ns 4.94ns 21.6ns 0.00937 0 0 696 B
master RunOnMethodBegin net472 1.06μs 0.563ns 2.18ns 0.104 0 0 658 B
#5671 RunOnMethodBegin net6.0 678ns 0.218ns 0.846ns 0.00985 0 0 696 B
#5671 RunOnMethodBegin netcoreapp3.1 895ns 0.207ns 0.804ns 0.00938 0 0 696 B
#5671 RunOnMethodBegin net472 1.16μs 0.531ns 1.99ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Jun 8, 2024

Throughput/Crank Report:zap:

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 (5671) (11.640M)   : 0, 11639714
    master (11.842M)   : 0, 11842369
    benchmarks/2.9.0 (12.049M)   : 0, 12048905

    section Automatic
    This PR (5671) (7.792M)   : 0, 7792405
    master (7.999M)   : 0, 7998666
    benchmarks/2.9.0 (8.464M)   : 0, 8463997

    section Trace stats
    master (8.337M)   : 0, 8336641

    section Manual
    This PR (5671) (9.935M)   : 0, 9935447
    master (10.173M)   : 0, 10173108

    section Manual + Automatic
    This PR (5671) (7.393M)   : 0, 7392707
    master (7.350M)   : 0, 7349541

    section Version Conflict
    master (6.703M)   : 0, 6702940

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5671) (9.500M)   : 0, 9499852
    master (9.512M)   : 0, 9511621
    benchmarks/2.9.0 (9.590M)   : 0, 9590349

    section Automatic
    This PR (5671) (6.611M)   : 0, 6610977
    master (6.515M)   : 0, 6515399

    section Trace stats
    master (6.862M)   : 0, 6861752

    section Manual
    This PR (5671) (8.272M)   : 0, 8272433
    master (8.299M)   : 0, 8298527

    section Manual + Automatic
    This PR (5671) (6.097M)   : 0, 6097316
    master (6.262M)   : 0, 6262373

    section Version Conflict
    master (5.588M)   : 0, 5588112

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5671) (10.186M)   : 0, 10186347
    master (10.162M)   : 0, 10161696
    benchmarks/2.9.0 (10.465M)   : 0, 10465033

    section Automatic
    This PR (5671) (7.320M)   : 0, 7319759
    master (7.293M)   : 0, 7293498
    benchmarks/2.9.0 (7.635M)   : 0, 7635248

    section Trace stats
    master (7.497M)   : 0, 7496532

    section Manual
    This PR (5671) (8.973M)   : 0, 8973323
    master (9.243M)   : 0, 9243291

    section Manual + Automatic
    This PR (5671) (6.953M)   : 0, 6952683
    master (6.976M)   : 0, 6975655

    section Version Conflict
    master (6.267M)   : 0, 6266553

Loading

@bouwkast bouwkast force-pushed the steven/otel-unknown-service-name branch from da5a209 to 3fe3f74 Compare July 1, 2024 20:05
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

4 occurrences of :

+    Resource: service.name should be the DefaultServiceName value,
+    Service: CustomServiceName,
+    Type: custom,
+    Tags: {
+      env: integration_tests,
+      language: dotnet,
+      otel.library.name: MissingServiceName,
+      otel.status_code: STATUS_CODE_UNSET,
+      otel.trace_id: Guid_7,
+      runtime-id: Guid_2,
+      service.name: CustomServiceName,
+      span.kind: internal,
+      telemetry.sdk.language: dotnet,
+      telemetry.sdk.name: opentelemetry,
+      telemetry.sdk.version: sdk-version
+    },
+    Metrics: {
+      process_id: 0,
+      _dd.top_level: 1.0,
+      _dd.tracer_kr: 1.0,
+      _sampling_priority_v1: 1.0
+    }
+  },
+  {
+    TraceId: Id_42,
+    SpanId: Id_43,
+    Name: internal,

12 occurrences of :

-      otel.trace_id: Guid_7,
+      otel.trace_id: Guid_8,

4 occurrences of :

+    Resource: service.name should be the DefaultServiceName value,
+    Service: CustomServiceName,
+    Type: custom,
+    Tags: {
+      env: integration_tests,
+      language: dotnet,
+      otel.library.name: MissingServiceName,
+      otel.status_code: STATUS_CODE_UNSET,
+      otel.trace_id: Guid_7,
+      runtime-id: Guid_2,
+      service.name: CustomServiceName,
+      span.kind: internal
+    },
+    Metrics: {
+      process_id: 0,
+      _dd.top_level: 1.0,
+      _dd.tracer_kr: 1.0,
+      _sampling_priority_v1: 1.0
+    }
+  },
+  {
+    TraceId: Id_42,
+    SpanId: Id_43,
+    Name: internal,

2 occurrences of :

+    Name: MissingServiceName.internal,
+    Resource: service.name should be the DefaultServiceName value,
+    Service: CustomServiceName,
+    Type: custom,
+    Tags: {
+      env: integration_tests,
+      language: dotnet,
+      otel.library.name: MissingServiceName,
+      otel.status_code: STATUS_CODE_UNSET,
+      otel.trace_id: Guid_7,
+      runtime-id: Guid_2,
+      service.name: CustomServiceName,
+      span.kind: internal
+    },
+    Metrics: {
+      process_id: 0,
+      _dd.top_level: 1.0,
+      _dd.tracer_kr: 1.0,
+      _sampling_priority_v1: 1.0
+    }
+  },
+  {
+    TraceId: Id_42,
+    SpanId: Id_43,

2 occurrences of :

+    Name: MissingServiceName.internal,
+    Resource: service.name should be the DefaultServiceName value,
+    Service: CustomServiceName,
+    Type: custom,
+    Tags: {
+      env: integration_tests,
+      language: dotnet,
+      otel.library.name: MissingServiceName,
+      otel.status_code: STATUS_CODE_UNSET,
+      otel.trace_id: Guid_7,
+      runtime-id: Guid_2,
+      service.name: CustomServiceName,
+      span.kind: internal,
+      telemetry.sdk.language: dotnet,
+      telemetry.sdk.name: opentelemetry,
+      telemetry.sdk.version: sdk-version
+    },
+    Metrics: {
+      process_id: 0,
+      _dd.top_level: 1.0,
+      _dd.tracer_kr: 1.0,
+      _sampling_priority_v1: 1.0
+    }
+  },
+  {
+    TraceId: Id_42,
+    SpanId: Id_43,

@bouwkast bouwkast marked this pull request as ready for review July 1, 2024 20:19
@bouwkast bouwkast requested a review from a team as a code owner July 1, 2024 20:19
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jul 1, 2024

Datadog Report

Branch report: steven/otel-unknown-service-name
Commit report: 3ed79e8
Test service: dd-trace-dotnet

✅ 0 Failed, 352834 Passed, 1771 Skipped, 14h 36m 43.11s Total Time
❄️ 1 New Flaky

New Flaky Tests (1)

  • SimpleActivitiesAndSpansTest - Datadog.Trace.Tests.ActivityTests - Last Failure

    Expand for error
     Expected childActivity.ParentSpanId.ToString() to be "349f87d01a6ca40a", but "3a754ce9ca90befa" differs near "a75" (index 1).
    

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.

:shipit:

@@ -949,6 +949,33 @@ at Samples.OpenTelemetrySdk.Program.RunSpanUpdateMethods(TelemetrySpan span),
TraceId: Id_40,
SpanId: Id_41,
Name: internal,
Resource: service.name should be the DefaultServiceName value,
Copy link
Member

Choose a reason for hiding this comment

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

I really like this approach of having the verbose "assertion" in the Resource to make it easier to check the spans 👍

@bouwkast bouwkast force-pushed the steven/otel-unknown-service-name branch from f49ac1a to 33deb34 Compare July 3, 2024 16:04
@bouwkast bouwkast changed the base branch from master to steven/activity-key-fix July 3, 2024 16:04
Base automatically changed from steven/activity-key-fix to master July 10, 2024 19:08
@bouwkast bouwkast force-pushed the steven/otel-unknown-service-name branch from 33deb34 to 3ed79e8 Compare July 10, 2024 19:15
@bouwkast bouwkast merged commit ebb6108 into master Jul 11, 2024
57 of 59 checks passed
@bouwkast bouwkast deleted the steven/otel-unknown-service-name branch July 11, 2024 12:42
@github-actions github-actions bot added this to the vNext-v2 milestone Jul 11, 2024
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.

Unknown service created when using Hangfire instrumentation
3 participants