From 422eeb71f40c73d1b195723cc1cffeb09abf2391 Mon Sep 17 00:00:00 2001 From: Johannes Tax Date: Mon, 16 Sep 2024 20:22:26 +0200 Subject: [PATCH] Give exhaustive specification of span kinds for messaging spans (#1171) Co-authored-by: Liudmila Molkova Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> --- .chloggen/1112.yaml | 4 ++++ docs/messaging/messaging-spans.md | 20 ++++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 .chloggen/1112.yaml diff --git a/.chloggen/1112.yaml b/.chloggen/1112.yaml new file mode 100644 index 000000000..454aa19d7 --- /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] diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 7f5b43198..9e3c32abc 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -208,21 +208,13 @@ 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. | -| `receive` | `CONSUMER` | -| `process` | `CONSUMER` for push-based scenarios where no "Receive" span exists. | +| `create` | `PRODUCER` | +| `publish` | `PRODUCER` if the context of the "Publish" span is used as creation context, otherwise `CLIENT`. | +| `receive` | `CLIENT` | +| `process` | `CONSUMER` | -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. +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