Skip to content

Commit

Permalink
Add consumer_id to identify the consumer (#1810)
Browse files Browse the repository at this point in the history
Resolves #1796
  • Loading branch information
kenfinnigan committed Aug 23, 2021
1 parent 8726861 commit 028ac12
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 @@ -68,6 +68,8 @@ release.
- Add mobile-related network state: `net.host.connection.type`, `net.host.connection.subtype` & `net.host.carrier.*` [#1647](https://github.com/open-telemetry/opentelemetry-specification/issues/1647)
- 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 028ac12

Please sign in to comment.