Obfuscate query strings in WCF http.url tag#8643
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 4 occurrences of : - Resource: ServerSyncAddWrapped,
+ Resource: ServerSyncAddJsonQuery,
4 occurrences of : - Resource: POST localhost:00000/ServerSyncAddWrapped,
+ Resource: GET localhost:00000/ServerSyncAddJsonQuery/?,
[...]
- http.method: POST,
+ http.method: GET,
[...]
- http.url: http://localhost:00000/ServerSyncAddWrapped,
+ http.url: http://localhost:00000/ServerSyncAddJsonQuery/1?n2=2&<redacted>,
2 occurrences of : - Resource: /ServerSyncAddWrapped,
+ Resource: /ServerSyncAddJsonQuery/?,
4 occurrences of : - http.method: POST,
+ http.method: GET,
[...]
- http.url: http://localhost:00000/ServerSyncAddWrapped,
+ http.url: http://localhost:00000/ServerSyncAddJsonQuery/1?n2=2&<redacted>,
4 occurrences of : - Name: ServerSyncAddWrapped,
- Resource: ServerSyncAddWrapped,
+ Name: ServerSyncAddJsonQuery,
+ Resource: ServerSyncAddJsonQuery,
4 occurrences of : - Resource: ServerSyncAddXml,
+ Resource: ServerSyncAddWrapped,
4 occurrences of : - Resource: GET localhost:00000/ServerSyncAddXml/?/n2=2,
+ Resource: POST localhost:00000/ServerSyncAddWrapped,
[...]
- http.method: GET,
+ http.method: POST,
[...]
- http.url: http://localhost:00000/ServerSyncAddXml/1/n2=2,
+ http.url: http://localhost:00000/ServerSyncAddWrapped,
2 occurrences of : - Resource: /ServerSyncAddXml/?/n2=2,
+ Resource: /ServerSyncAddWrapped,
4 occurrences of : - http.method: GET,
+ http.method: POST,
[...]
- http.url: http://localhost:00000/ServerSyncAddXml/1/n2=2,
+ http.url: http://localhost:00000/ServerSyncAddWrapped,
4 occurrences of : - Name: ServerSyncAddXml,
- Resource: ServerSyncAddXml,
+ Name: ServerSyncAddWrapped,
+ Resource: ServerSyncAddWrapped,
4 occurrences of : - Resource: ServerTaskAddPost,
+ Resource: ServerSyncAddXml,
4 occurrences of : - Resource: POST localhost:00000/ServerTaskAddPost,
+ Resource: GET localhost:00000/ServerSyncAddXml/?/n2=2,
[...]
- http.method: POST,
+ http.method: GET,
[...]
- http.url: http://localhost:00000/ServerTaskAddPost,
+ http.url: http://localhost:00000/ServerSyncAddXml/1/n2=2,
2 occurrences of : - Resource: /ServerTaskAddPost,
+ Resource: /ServerSyncAddXml/?/n2=2,
4 occurrences of : - http.method: POST,
+ http.method: GET,
[...]
- http.url: http://localhost:00000/ServerTaskAddPost,
+ http.url: http://localhost:00000/ServerSyncAddXml/1/n2=2,
1 occurrences of : + Name: ServerSyncAddXml,
+ Resource: ServerSyncAddXml,
+ Service: Samples.Wcf,
+ ParentId: Id_19,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ version: 1.0.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_22,
+ Name: internal,
+ Resource: ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: custom,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ otel.library.name: Samples.Wcf,
+ otel.status_code: STATUS_CODE_UNSET,
+ otel.trace_id: Guid_6,
+ runtime-id: Guid_2,
+ span.kind: internal,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_23,
+ Name: http.request,
+ Resource: POST localhost:00000/ServerTaskAddPost,
+ Service: Samples.Wcf-http-client,
+ Type: http,
+ ParentId: Id_22,
+ Tags: {
+ component: WebRequest,
+ env: integration_tests,
+ http.method: POST,
+ http.status_code: 200,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ out.host: localhost,
+ runtime-id: Guid_2,
+ span.kind: client,
+ _dd.base_service: Samples.Wcf,
+ _dd.svc_src: http-client
+ },
+ Metrics: {
+ _dd.top_level: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_24,
+ Name: wcf.request,
+ Resource: /ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: web,
+ ParentId: Id_23,
+ Tags: {
+ component: Wcf,
+ custom-tag: DispatchMessageInspector,
+ env: integration_tests,
+ http.method: POST,
+ http.request.headers.host: localhost:00000,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ runtime-id: Guid_2,
+ span.kind: server,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_25,
[...]
- ParentId: Id_19,
+ ParentId: Id_24,
2 occurrences of : - Resource: POST /ServerSyncAddWrapped,
+ Resource: GET /ServerSyncAddJsonQuery/{n1}?n2={n2}&api_key={apiKey},
2 occurrences of : - Resource: GET /ServerSyncAddXml/{n1}/n2={n2},
+ Resource: POST /ServerSyncAddWrapped,
2 occurrences of : - Resource: POST /ServerTaskAddPost,
+ Resource: GET /ServerSyncAddXml/{n1}/n2={n2},
1 occurrences of : + Name: ServerSyncAddXml,
+ Resource: ServerSyncAddXml,
+ Service: Samples.Wcf,
+ ParentId: Id_19,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ version: 1.0.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_22,
+ Name: internal,
+ Resource: ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: custom,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ otel.library.name: Samples.Wcf,
+ otel.status_code: STATUS_CODE_UNSET,
+ otel.trace_id: Guid_6,
+ runtime-id: Guid_2,
+ span.kind: internal,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_23,
+ Name: http.request,
+ Resource: POST localhost:00000/ServerTaskAddPost,
+ Service: Samples.Wcf-http-client,
+ Type: http,
+ ParentId: Id_22,
+ Tags: {
+ component: WebRequest,
+ env: integration_tests,
+ http.method: POST,
+ http.status_code: 200,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ out.host: localhost,
+ runtime-id: Guid_2,
+ span.kind: client,
+ _dd.base_service: Samples.Wcf,
+ _dd.svc_src: http-client
+ },
+ Metrics: {
+ _dd.top_level: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_24,
+ Name: wcf.request,
+ Resource: POST /ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: web,
+ ParentId: Id_23,
+ Tags: {
+ component: Wcf,
+ custom-tag: DispatchMessageInspector,
+ env: integration_tests,
+ http.method: POST,
+ http.request.headers.host: localhost:00000,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ runtime-id: Guid_2,
+ span.kind: server,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_25,
[...]
- ParentId: Id_19,
+ ParentId: Id_24,
1 occurrences of : + Name: ServerSyncAddXml,
+ Resource: ServerSyncAddXml,
+ Service: Samples.Wcf,
+ ParentId: Id_19,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ version: 1.0.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_22,
+ Name: internal,
+ Resource: ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: custom,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ otel.library.name: Samples.Wcf,
+ otel.status_code: STATUS_CODE_UNSET,
+ otel.trace_id: Guid_6,
+ runtime-id: Guid_2,
+ span.kind: internal,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_23,
+ Name: http.client.request,
+ Resource: POST localhost:00000/ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: http,
+ ParentId: Id_22,
+ Tags: {
+ component: WebRequest,
+ env: integration_tests,
+ http.method: POST,
+ http.status_code: 200,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ out.host: localhost,
+ peer.service: localhost,
+ span.kind: client,
+ version: 1.0.0,
+ _dd.peer.service.source: out.host
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_24,
+ Name: http.server.request,
+ Resource: /ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: web,
+ ParentId: Id_23,
+ Tags: {
+ component: Wcf,
+ custom-tag: DispatchMessageInspector,
+ env: integration_tests,
+ http.method: POST,
+ http.request.headers.host: localhost:00000,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ runtime-id: Guid_2,
+ span.kind: server,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_25,
[...]
- ParentId: Id_19,
+ ParentId: Id_24,
1 occurrences of : + Name: ServerSyncAddXml,
+ Resource: ServerSyncAddXml,
+ Service: Samples.Wcf,
+ ParentId: Id_19,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ version: 1.0.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_22,
+ Name: internal,
+ Resource: ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: custom,
+ Tags: {
+ env: integration_tests,
+ language: dotnet,
+ otel.library.name: Samples.Wcf,
+ otel.status_code: STATUS_CODE_UNSET,
+ otel.trace_id: Guid_6,
+ runtime-id: Guid_2,
+ span.kind: internal,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_23,
+ Name: http.client.request,
+ Resource: POST localhost:00000/ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: http,
+ ParentId: Id_22,
+ Tags: {
+ component: WebRequest,
+ env: integration_tests,
+ http.method: POST,
+ http.status_code: 200,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ out.host: localhost,
+ peer.service: localhost,
+ span.kind: client,
+ version: 1.0.0,
+ _dd.peer.service.source: out.host
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_24,
+ Name: http.server.request,
+ Resource: POST /ServerTaskAddPost,
+ Service: Samples.Wcf,
+ Type: web,
+ ParentId: Id_23,
+ Tags: {
+ component: Wcf,
+ custom-tag: DispatchMessageInspector,
+ env: integration_tests,
+ http.method: POST,
+ http.request.headers.host: localhost:00000,
+ http.url: http://localhost:00000/ServerTaskAddPost,
+ language: dotnet,
+ runtime-id: Guid_2,
+ span.kind: server,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
+ {
+ TraceId: Id_21,
+ SpanId: Id_25,
[...]
- ParentId: Id_19,
+ ParentId: Id_24,
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8643) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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 highlighted in **red**. The following thresholds were used for comparing the execution times:
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). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (73ms) : 71, 76
master - mean (73ms) : 70, 75
section Bailout
This PR (8643) - mean (79ms) : 76, 83
master - mean (79ms) : 75, 83
section CallTarget+Inlining+NGEN
This PR (8643) - mean (1,108ms) : 1058, 1158
master - mean (1,104ms) : 1056, 1153
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (117ms) : 111, 123
master - mean (113ms) : 109, 117
section Bailout
This PR (8643) - mean (116ms) : 112, 121
master - mean (118ms) : 113, 124
section CallTarget+Inlining+NGEN
This PR (8643) - mean (790ms) : 763, 818
master - mean (787ms) : 759, 814
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (101ms) : 98, 104
master - mean (102ms) : 98, 106
section Bailout
This PR (8643) - mean (102ms) : 99, 104
master - mean (106ms) : 100, 111
section CallTarget+Inlining+NGEN
This PR (8643) - mean (943ms) : 900, 986
master - mean (946ms) : 907, 986
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (102ms) : 98, 107
master - mean (99ms) : 95, 103
section Bailout
This PR (8643) - mean (101ms) : 98, 104
master - mean (103ms) : 98, 108
section CallTarget+Inlining+NGEN
This PR (8643) - mean (826ms) : 796, 855
master - mean (822ms) : 788, 856
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (199ms) : 192, 205
master - mean (202ms) : 194, 210
section Bailout
This PR (8643) - mean (202ms) : 196, 208
master - mean (206ms) : 198, 213
section CallTarget+Inlining+NGEN
This PR (8643) - mean (1,201ms) : 1153, 1248
master - mean (1,205ms) : 1159, 1251
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (286ms) : 279, 294
master - mean (288ms) : 281, 295
section Bailout
This PR (8643) - mean (285ms) : 279, 291
master - mean (290ms) : 283, 296
section CallTarget+Inlining+NGEN
This PR (8643) - mean (965ms) : 943, 986
master - mean (967ms) : 941, 992
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (280ms) : 274, 286
master - mean (281ms) : 275, 287
section Bailout
This PR (8643) - mean (279ms) : 269, 289
master - mean (280ms) : 275, 285
section CallTarget+Inlining+NGEN
This PR (8643) - mean (1,159ms) : 1124, 1194
master - mean (1,163ms) : 1117, 1208
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8643) - mean (280ms) : 272, 288
master - mean (281ms) : 274, 289
section Bailout
This PR (8643) - mean (279ms) : 274, 285
master - mean (282ms) : 275, 288
section CallTarget+Inlining+NGEN
This PR (8643) - mean (1,043ms) : 1002, 1083
master - mean (1,041ms) : 997, 1085
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
Obfuscate query strings in the
http.urltag for WCF spans, matching the behavior of other HTTP integrations.Reason for change
We do this in other HTTP integrations, but was missed for WCF
Implementation details
Added WcfCommon.BuildHttpUrl to route the WCF request URI through HttpRequestUtils.GetUrl so they get obfuscated like other HTTP intstrumentations.
Note: Only http/https URIs go through the obfuscator. Other WCF transports (net.tcp, net.pipe, net.msmq, etc.) fall back to uri.AbsoluteUri since GetUrl expects a scheme://host/path shape.
Test coverage
Updated sample app and snapshots as we didn't have any tests that used query strings.
Other details
Is this a breaking change? It is a bug, but I guess we are changing tags.
The snapshots look noisy but the only real change / addition here should be this method
public double ServerSyncAddJsonQuery(string n1, string n2, string apiKey) => GetResult(n1, n2);I think it is just because of the sorting that it looks like more stuff changed.