Skip to content

Commit 9177a93

Browse files
dougqhclaude
andcommitted
Add peer tags to messaging spans; apply code origin to handler spans
Two review findings, both confirmed in the code: - RabbitChannelInstrumentation calls onPeerConnection on its client, producer and consumer decorators. messaging.producer and messaging.client now include peer, peer_address and outbound_peer (peer.service is computed for client and producer spans, as for http.client and rpc.client); messaging.consumer includes peer_address and inbound_peer. Consumers also set peer.hostname, which outbound_peer declares for client spans only: a TODO, as for websocket spans. - Code origin's entry capture instruments annotated controller methods, whose active span is the framework's handler span, so the code_origin mixin also applies to web.handler. Slots unchanged at 47 with #12882's coloring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 20a0148 commit 9177a93

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎tag-conventions.yaml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,14 @@ span_types:
262262
messaging.producer:
263263
extends: messaging
264264
span-kind: producer
265+
include: [ peer, peer_address, outbound_peer ]
265266

267+
# TODO: RabbitMQ consumers also set peer.hostname, which outbound_peer declares for client spans only
268+
# (as on websocket spans).
266269
messaging.consumer:
267270
extends: messaging
268271
span-kind: consumer
272+
include: [ peer_address, inbound_peer ]
269273
tags:
270274
- { dd-name: record.queue_time_ms, type: long, required: optional } # from the message's timestamp, when it has one
271275
- { dd-name: record.e2e_duration_ms, type: long, required: optional } # only when end-to-end durations are enabled
@@ -279,6 +283,7 @@ span_types:
279283
messaging.client:
280284
extends: messaging
281285
span-kind: client
286+
include: [ peer, peer_address, outbound_peer ]
282287

283288
# A consumer's poll for a batch (span.kind unset).
284289
messaging.poll:
@@ -379,11 +384,12 @@ mixins:
379384
tags:
380385
- { dd-name: peer.port, type: int, otel-name: client.port }
381386

382-
# code_origin — the debugger's code origin, on entry spans (and their local root) and @Trace spans.
387+
# code_origin — the debugger's code origin, on entry spans (and their local root), annotated
388+
# controller methods' handler spans, and @Trace spans.
383389
# Only the origin's type is registered: its frames are _dd.code_origin.frames.<N>.<field>, a name
384390
# pattern, which the registry doesn't model yet. (Only frame 0 is produced today.)
385391
code_origin:
386-
applies: [ http.server, rpc.server, messaging.consumer, internal ]
392+
applies: [ http.server, rpc.server, messaging.consumer, internal, web.handler ]
387393
tags:
388394
- { dd-name: _dd.code_origin.type, type: string, required: optional }
389395

0 commit comments

Comments
 (0)