Skip to content

Commit

Permalink
Give exhaustive specification of span kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
pyohannes committed Jun 20, 2024
1 parent 82c0926 commit 67fa8c1
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions docs/messaging/messaging-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,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.33.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

Expand Down

0 comments on commit 67fa8c1

Please sign in to comment.