Skip to content

Normalize per-instance RabbitMQ names in Data Streams edge tags - #13589

Draft
arjunguhaswe wants to merge 2 commits into
masterfrom
arjunguha/dsm2-806-tracers-normalize-per-instance-rabbitmq
Draft

arjunguhaswe wants to merge 2 commits into
masterfrom
arjunguha/dsm2-806-tracers-normalize-per-instance-rabbitmq

Conversation

@arjunguhaswe

@arjunguhaswe arjunguhaswe commented Nov 20, 2026 •

Copy link
Copy Markdown

What Does This Do

Data Streams Monitoring (DSM) now normalizes per-instance RabbitMQ queue, routing key and exchange names before putting them in the topic: / exchange: edge tags, on both produce and consume:

Pattern Example DSM tag value
Server-named queue amq.gen-JzTY20BRgKO-HjmUJj0wLg amq.gen-*
Direct reply-to amq.rabbitmq.reply-to.g1h2AA5y... amq.rabbitmq.reply-to
MassTransit bus/temp endpoint ip-10-0-1-2_PaymentService_bus_ybyyyyb6tamq6nr4bdpwzyhwbo *_PaymentService_bus_*
Wolverine node queues wolverine.control.3, wolverine.response.<uuid> wolverine.control.*, wolverine.response.*
Trailing UUID (dashed or 32 hex) callback-8f14e45f-ceea-467a-9f3a-6b1f1e2c0a11 callback-*
Trailing 16+ hex chars membership-9f8e7d6c5b4a39281706f5e4d3c2b1a0 membership-*
Bare UUID (whole name, dashed or 32 hex) 8f14e45f-ceea-467a-9f3a-6b1f1e2c0a11 *

Anything else is unchanged (e.g. orders, orders-v2, queue-abc123).

Span tags, resource names and the propagation-disabled-destination check still use the raw names.

Motivation

These names are hashed into the DSM pathway, so every server-named, reply or per-host queue creates new DSM nodes and new (hash, parent) pairs. In an internal investigation of high DSM cardinality, this was a recurring contributor: pathways got dropped by the per-service hash quota and the map filled up with one-off queues.

Additional Notes

  • How: new RabbitDsmNames.normalize() in rabbitmq-amqp-2.7, used by RabbitDecorator.startReceivingSpan (consume) and ChannelPublishContextPropagationAdvice (produce: the routing key on the default exchange, else the exchange name). spring-rabbit goes through the same code.
  • No regex: the rules are hand-written string checks, since this runs per message. Names that match no rule are returned as the same instance, with no allocation.
  • No cache: this instrumentation builds DataStreamsTags per message today, and a cache keyed on the raw name would fill with exactly these names.
  • No opt-out setting, matching the existing span-side normalizeQueueName.
  • Rule breadth: 16+ hex chars after a separator also matches long numeric IDs (orders-1234567890123456). Feedback welcome on whether that is too broad.
  • Same rules in .NET ([DSM] Normalize per-instance RabbitMQ queue names in edge tags dd-trace-dotnet#9772) and Node (fix(dsm): normalize per-instance RabbitMQ names in DSM edge tags dd-trace-js#11354).

Testing

  • New RabbitDsmNamesTest (JUnit 5, @TableTest): every pattern above plus negatives (orders-v2, queue-abc123, 15-hex suffix, 35-char near-UUID, 31 hex, malformed bus/wolverine names), and idempotence.
  • RabbitMQTest: DSM assertions on server-named queues now expect topic:amq.gen-*; new feature checks callback-<uuid> → topic:callback-* and events-<32 hex> → exchange:events-*; a bare UUID.randomUUID() queue → topic:*.
  • test, forkedTest, latestDepTest, latestDepForkedTest, reactorTest, latestReactorTest pass; spotless clean.

Jira ticket: DSM2-806

🤖 Generated with Claude Code

Server-named queues, direct reply-to, bus endpoints, node queues and
names with a random UUID or long hex suffix put a new value into the DSM
topic/exchange edge tags for every process or request, creating new
pathway hashes each time. Normalize those names (for example
amq.gen-* or callback-*) before building the DSM tags on produce and
consume. Span tags and resource names keep the raw names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arjunguhaswe arjunguhaswe added type: bug fix Bug fix inst: rabbitmq RabbitMQ instrumentation comp: data streams Data Streams Monitoring labels Nov 20, 2026
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

DSM2-806

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+7.89%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 074a759 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.08 s 14.06 s [-0.6%; +0.9%] (no difference)
startup:insecure-bank:tracing:Agent 13.01 s 12.99 s [-0.7%; +0.9%] (no difference)
startup:petclinic:appsec:Agent 17.14 s 17.12 s [-0.8%; +1.0%] (no difference)
startup:petclinic:iast:Agent 17.03 s 17.16 s [-1.6%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 16.19 s 16.24 s [-6.5%; +5.9%] (unstable)
startup:petclinic:sca:Agent 17.16 s 17.01 s [-0.0%; +1.8%] (no difference)
startup:petclinic:tracing:Agent 16.15 s 16.49 s [-3.1%; -1.0%] (maybe better)

Commit: 074a7594 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: data streams Data Streams Monitoring inst: rabbitmq RabbitMQ instrumentation type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant