From ec04c7a7d11f3b185eb6a9fbffe58c15fa2ec631 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Thu, 20 Jun 2024 15:22:41 +0200 Subject: [PATCH 1/3] Give exhaustive specification of span kinds --- docs/messaging/messaging-spans.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 7f5b431983..bd3809a14f 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -209,20 +209,14 @@ Span kind SHOULD be set according to the following table, based on the operation | Operation type | Span kind| |----------------|-------------| | `create` | `PRODUCER` | -| `publish` | `PRODUCER` if the context of the "Publish" span is used as creation context. | +| `publish` | `PRODUCER` if the context of the "Publish" span is used as creation context, otherwise `CLIENT`. | | `receive` | `CONSUMER` | -| `process` | `CONSUMER` for push-based scenarios where no "Receive" span exists. | - -For cases not covered by the table above, the span kind should be set according -to the [generic specification about span kinds](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.35.0/specification/trace/api.md#spankind), -e. g. it should be set to CLIENT for the "Publish" span if its context is not -used as creation context and if the "Publish" span models a synchronous call to -the intermediary. - -Setting span kinds according to this table ensures that span links between -consumers and producers always exist between a PRODUCER span on the producer -side and a CONSUMER span on the consumer side. This allows analysis tools to -interpret linked traces without the need for additional semantic hints. +| `process` | `CONSUMER` for push-based scenarios where no "Receive" span exists, otherwise `SERVER`. | + +Setting span kinds according to this table ensures that there always exists a +span link between a PRODUCER span on the producer side and a CONSUMER span on +the consumer side. This allows analysis tools to interpret linked traces +without the need for additional semantic hints. ### Trace structure From 9d1ca8c795322e302596cdf23afe555d3311dc22 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Thu, 20 Jun 2024 15:28:26 +0200 Subject: [PATCH 2/3] Add changelog --- .chloggen/1112.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .chloggen/1112.yaml diff --git a/.chloggen/1112.yaml b/.chloggen/1112.yaml new file mode 100644 index 0000000000..454aa19d76 --- /dev/null +++ b/.chloggen/1112.yaml @@ -0,0 +1,4 @@ +change_type: enhancement +component: messaging +note: Define span kind for unspecified cases of messaging `publish` and `process` spans. +issues: [1112] From 862c1a97f94172ebfdbfe0755ad343b11f9988a3 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 4 Sep 2024 14:29:58 -0700 Subject: [PATCH 3/3] update based on spec changes --- docs/messaging/messaging-spans.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index bd3809a14f..9e3c32abcd 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -208,15 +208,13 @@ Span kind SHOULD be set according to the following table, based on the operation | Operation type | Span kind| |----------------|-------------| -| `create` | `PRODUCER` | +| `create` | `PRODUCER` | | `publish` | `PRODUCER` if the context of the "Publish" span is used as creation context, otherwise `CLIENT`. | -| `receive` | `CONSUMER` | -| `process` | `CONSUMER` for push-based scenarios where no "Receive" span exists, otherwise `SERVER`. | +| `receive` | `CLIENT` | +| `process` | `CONSUMER` | -Setting span kinds according to this table ensures that there always exists a -span link between a PRODUCER span on the producer side and a CONSUMER span on -the consumer side. This allows analysis tools to interpret linked traces -without the need for additional semantic hints. +Setting span kinds according to this table allows analysis tools to interpret spans +and relationships between them without the need for additional semantic hints. ### Trace structure