Skip to content

Commit b0f802a

Browse files
adinauerclaude
andcommitted
fix(otel): Map messaging "settle" to queue.settle
OTel messaging semconv defines messaging.operation.type=settle for consumer ack/nack/reject spans (JMS, RabbitMQ, Pulsar acknowledge). The switch had no case for "settle", so settle spans on SpanKind.CONSUMER were falling through to the SpanKind fallback and becoming queue.process — duplicating the real process span — while on SpanKind.CLIENT they became the generic "queue" default. queue.settle is one of the canonical Queues telemetry ops per https://develop.sentry.dev/sdk/telemetry/traces/modules/queues/, so add the explicit mapping. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6040247 commit b0f802a

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/SpanDescriptionExtractor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ private OtelSpanInfo descriptionForMessagingSystem(final @NotNull SpanData otelS
136136
case "process":
137137
case "deliver":
138138
return "queue.process";
139+
case "settle":
140+
return "queue.settle";
139141
default:
140142
// fall through to SpanKind mapping
141143
break;

sentry-opentelemetry/sentry-opentelemetry-core/src/test/kotlin/SpanDescriptionExtractorTest.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,23 @@ class SpanDescriptionExtractorTest {
316316
assertEquals(TransactionNameSource.TASK, info.transactionNameSource)
317317
}
318318

319+
@Test
320+
fun `maps messaging settle operation type to queue settle op`() {
321+
givenAttributes(
322+
mapOf(
323+
MessagingIncubatingAttributes.MESSAGING_SYSTEM to "rabbitmq",
324+
MessagingIncubatingAttributes.MESSAGING_DESTINATION_NAME to "my-queue",
325+
MessagingIncubatingAttributes.MESSAGING_OPERATION_TYPE to "settle",
326+
)
327+
)
328+
329+
val info = whenExtractingSpanInfo(queueTracingEnabled = true)
330+
331+
assertEquals("queue.settle", info.op)
332+
assertEquals("my-queue", info.description)
333+
assertEquals(TransactionNameSource.TASK, info.transactionNameSource)
334+
}
335+
319336
@Test
320337
fun `falls back to legacy messaging operation attribute`() {
321338
@Suppress("DEPRECATION")

0 commit comments

Comments
 (0)