[IBM MQ] Fix queue naming by removing URI prefix#8080
Conversation
Sanitize IBM MQ queue names by stripping `queue://` and `topic://` URI scheme prefixes from queue names in DSM edge tags, span tags, and resource names. This aligns with how other messaging integrations report queue/topic names and matches the expected format in the Datadog UI. Before: `queue://my_ibmmq.queue.1` After: `my_ibmmq.queue.1` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/IbmMq/IbmMqHelper.cs
Outdated
Show resolved
Hide resolved
BenchmarksBenchmark execution time: 2026-01-20 20:41:28 Comparing candidate commit aeea635 in PR branch Found 16 performance improvements and 5 performance regressions! Performance is the same for 151 metrics, 20 unstable metrics. scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1
scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0
scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8080) 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 (8080) - mean (73ms) : 69, 77
master - mean (73ms) : 70, 76
section Bailout
This PR (8080) - mean (77ms) : 74, 81
master - mean (78ms) : 75, 82
section CallTarget+Inlining+NGEN
This PR (8080) - mean (1,055ms) : 980, 1129
master - mean (1,059ms) : 972, 1146
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 (8080) - mean (112ms) : 106, 118
master - mean (115ms) : 110, 120
section Bailout
This PR (8080) - mean (114ms) : 110, 119
master - mean (116ms) : 113, 120
section CallTarget+Inlining+NGEN
This PR (8080) - mean (782ms) : 702, 861
master - mean (777ms) : 710, 844
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8080) - mean (101ms) : 95, 107
master - mean (102ms) : 98, 106
section Bailout
This PR (8080) - mean (103ms) : 98, 108
master - mean (103ms) : 98, 108
section CallTarget+Inlining+NGEN
This PR (8080) - mean (736ms) : 673, 800
master - mean (738ms) : 672, 804
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8080) - mean (100ms) : 96, 104
master - mean (99ms) : 94, 104
section Bailout
This PR (8080) - mean (101ms) : 97, 105
master - mean (101ms) : 97, 104
section CallTarget+Inlining+NGEN
This PR (8080) - mean (670ms) : 635, 705
master - mean (671ms) : 634, 708
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 (8080) - mean (198ms) : 191, 205
master - mean (194ms) : 190, 198
section Bailout
This PR (8080) - mean (203ms) : 195, 210
master - mean (200ms) : 195, 205
section CallTarget+Inlining+NGEN
This PR (8080) - mean (1,145ms) : 1079, 1211
master - mean (1,132ms) : 1065, 1200
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 (8080) - mean (281ms) : 275, 286
master - mean (279ms) : 274, 285
section Bailout
This PR (8080) - mean (281ms) : 276, 287
master - mean (279ms) : 275, 282
section CallTarget+Inlining+NGEN
This PR (8080) - mean (944ms) : 898, 991
master - mean (942ms) : 902, 981
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8080) - mean (273ms) : 267, 279
master - mean (273ms) : 267, 278
section Bailout
This PR (8080) - mean (272ms) : 269, 275
master - mean (272ms) : 266, 277
section CallTarget+Inlining+NGEN
This PR (8080) - mean (923ms) : 863, 984
master - mean (928ms) : 876, 981
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8080) - mean (271ms) : 264, 278
master - mean (271ms) : 266, 276
section Bailout
This PR (8080) - mean (272ms) : 267, 276
master - mean (272ms) : 267, 277
section CallTarget+Inlining+NGEN
This PR (8080) - mean (838ms) : 818, 858
master - mean (837ms) : 814, 860
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Address review feedback to use the existing StringUtil.IsNullOrEmpty helper which properly handles nullability warnings on older runtimes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| [Fact] | ||
| public void SanitizeQueueName_HandlesQueueNameWithSpecialCharacters() | ||
| { | ||
| var result = IbmMqHelper.SanitizeQueueName("queue://MY.QUEUE_NAME-123"); |
There was a problem hiding this comment.
This test name says "with special characters." What are the special characters here?
Can we remove SanitizeQueueName_HandlesQueueNameWithSpecialCharacters(), or include this test case in SanitizeQueueName_RemovesQueueUriPrefix()?
There was a problem hiding this comment.
Done - moved to the existing Theory.
| } | ||
|
|
||
| [Fact] | ||
| public void SanitizeQueueName_HandlesEmptyQueueNameAfterPrefix() |
There was a problem hiding this comment.
Can we convert this from [Fact] to [Theory] and test for "topic://" as well?
There was a problem hiding this comment.
Done - converted to Theory with both queue:// and topic://.
Consolidate test for queue names with special characters (., _, -) into the existing SanitizeQueueName_RemovesQueueUriPrefix Theory instead of having a separate test method. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test both queue:// and topic:// prefixes with empty names after the prefix to ensure consistent behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
queue://andtopic://URI scheme prefixesBefore:
queue://my_ibmmq.queue.1After:
my_ibmmq.queue.1Changes
SanitizeQueueName()method toIbmMqHelper.csPutIntegration.csandGetIntegration.csto use sanitized names in DSM edge tagsCreateProducerScope()andCreateConsumerScope()to use sanitized namesTest plan
SanitizeQueueNamemethod covering:queue://prefix removal (case insensitive)topic://prefix removal (case insensitive)🤖 Generated with Claude Code