Skip to content

Commit

Permalink
Add consumer_id to identify the consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
kenfinnigan committed Aug 5, 2021
1 parent 7cef355 commit 60ee36f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ release.

- Adding alibaba cloud as a cloud provider.
([#1831](https://github.com/open-telemetry/opentelemetry-specification/pull/1831))
- Add `messaging.consumer_id` to differentiate between message consumers.
([#1810](https://github.com/open-telemetry/opentelemetry-specification/pull/1810))

### Compatibility

Expand Down
8 changes: 8 additions & 0 deletions semantic_conventions/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ groups:
[Operation names](#operation-names) section above.
If the operation is "send", this attribute MUST NOT be set, since the
operation can be inferred from the span kind in that case.
- id: consumer_id
type: string
brief: >
The identifier for the consumer receiving a message. For Kafka, set it to
`{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only
`messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id`
of the client consuming the message.
examples: 'mygroup - client-6'

- id: messaging.consumer.synchronous
prefix: messaging
Expand Down
1 change: 1 addition & 0 deletions specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ For message consumers, the following additional attributes may be set:
| Attribute | Type | Description | Examples | Required |
|---|---|---|---|---|
| `messaging.operation` | string | A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. | `receive` | No |
| `messaging.consumer_id` | string | The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. | `mygroup - client-6` | No |

`messaging.operation` MUST be one of the following:

Expand Down

0 comments on commit 60ee36f

Please sign in to comment.