Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt semantic conventions for the span name of messaging systems #690

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ the release.

## Unreleased

New:

Updates:

- Adapt messaging semantic conventions to include the operation in the span name ([#690](https://github.com/open-telemetry/opentelemetry-specification/pull/690))

## v0.6.0 (07-01-2020)

New:
Expand All @@ -19,6 +25,7 @@ New:
- Add peer.service to provide a user-configured name for a remote service ([#652](https://github.com/open-telemetry/opentelemetry-specification/pull/652))

Updates:

- Improve root Span description ([#645](https://github.com/open-telemetry/opentelemetry-specification/pull/645))
- Extend semantic conventions for RPC and allow non-gRPC calls ([#604](https://github.com/open-telemetry/opentelemetry-specification/pull/604))
- Revise and extend semantic conventions for databases ([#575](https://github.com/open-telemetry/opentelemetry-specification/pull/575))
Expand Down
39 changes: 35 additions & 4 deletions specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@

- [Definitions](#definitions)
- [Conventions](#conventions)
* [Span name](#span-name)
* [Span Kind](#span-kind)
- [Messaging attributes](#messaging-attributes)
* [Attributes specific to certain messaging systems](#attributes-specific-to-certain-messaging-systems)
+ [RabbitMQ](#rabbitmq)
- [Examples](#examples)
* [Topic with multiple consumers](#topic-with-multiple-consumers)
* [Batch receiving](#batch-receiving)
* [Batch processing](#batch-processing)

<!-- tocstop -->

Expand Down Expand Up @@ -41,11 +48,35 @@ Some messaging systems support the concept of *temporary destination* (often onl

Given these definitions, the remainder of this section describes the semantic conventions that shall be followed for Spans describing interactions with messaging systems.

**Span name:** The span name should usually be set to the message destination name.
The conversation ID should be used instead when it is expected to have lower cardinality.
In particular, the conversation ID must be used if the message destination is unnamed or temporary unless multiple conversations can be combined to a logical destination of lower cardinality.
### Span name

**Span kind:** A producer of a message should set the span kind to `PRODUCER` unless it synchronously waits for a response: then it should use `CLIENT`.
The span name SHOULD be set to the message destination name and the operation being performed in the following format:
jmacd marked this conversation as resolved.
Show resolved Hide resolved

```
<destination name> <operation name>
```

`<operation name>` can be any of `send`, `receive` or `process`.
arminru marked this conversation as resolved.
Show resolved Hide resolved

If the conversation ID is expected to have lower cardinality than the message destination name, it SHOULD be used instead.
In particular, the conversation ID SHOULD be used if the message destination is unnamed or temporary unless multiple conversations can be combined to a logical destination of lower cardinality.
arminru marked this conversation as resolved.
Show resolved Hide resolved

If the format above is used, the operation name MUST match the `messaging.operation` attribute defined for message consumer spans (operations `receive` and `process`) below.
arminru marked this conversation as resolved.
Show resolved Hide resolved

Examples:

* `shop.orders send`
* `shop.orders receive`
* `shop.orders process`
* `print_jobs send`
* `topic with spaces process`
* `conversation-A1B2C3D4 send`
* `conversation-A1B2C3D4 receive`
* `AuthenticationRequest-Conversations process`

### Span Kind

A producer of a message should set the span kind to `PRODUCER` unless it synchronously waits for a response: then it should use `CLIENT`.
The processor of the message should set the kind to `CONSUMER`, unless it always sends back a reply that is directed to the producer of the message
(as opposed to e.g., a queue on which the producer happens to listen): then it should use `SERVER`.

Expand Down