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

Define additional Azure messaging attributes #572

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ release.
([#545](https://github.com/open-telemetry/semantic-conventions/pull/545))
- Add `aws.ecs.task.id` attribute, corrected description for `aws.ecs.task.arn`.
([#597](https://github.com/open-telemetry/semantic-conventions/pull/597))
- Add Azure Service Bus and Event Hubs messaging attributes
([#572](https://github.com/open-telemetry/semantic-conventions/pull/572))

### Fixes

Expand Down
28 changes: 25 additions & 3 deletions docs/attributes-registry/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [Kafka Attributes](#kafka-attributes)
- [RabbitMQ Attributes](#rabbitmq-attributes)
- [RocketMQ Attributes](#rocketmq-attributes)
- [Azure Event Hubs Attributes](#azure-event-hubs-attributes)
- [Azure Service Bus Attributes](#azure-service-bus-attributes)

<!-- tocstop -->

Expand Down Expand Up @@ -66,9 +68,9 @@ size should be used.
|---|---|
| `activemq` | Apache ActiveMQ |
| `aws_sqs` | Amazon Simple Queue Service (SQS) |
| `azure_eventgrid` | Azure Event Grid |
| `azure_eventhubs` | Azure Event Hubs |
| `azure_servicebus` | Azure Service Bus |
| `eventgrid` | Azure Event Grid |
| `eventhubs` | Azure Event Hubs |
| `servicebus` | Azure Service Bus |
| `gcp_pubsub` | Google Cloud Pub/Sub |
trask marked this conversation as resolved.
Show resolved Hide resolved
| `jms` | Java Message Service |
| `kafka` | Apache Kafka |
Expand Down Expand Up @@ -137,3 +139,23 @@ size should be used.
| `delay` | Delay message |
| `transaction` | Transaction message |
<!-- endsemconv -->

## Azure Event Hubs Attributes

<!-- semconv registry.messaging(omit_requirement_level,tag=tech-specific-eventhubs) -->
| Attribute | Type | Description | Examples |
|---|---|---|---|
| `messaging.eventhubs.consumer.group` | string | The name of the consumer group the event consumer is associated with. | `indexer` |
| `messaging.eventhubs.destination.partition.id` | string | The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it. | `1` |
| `messaging.eventhubs.message.enqueued_time` | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` |
<!-- endsemconv -->

## Azure Service Bus Attributes

<!-- semconv registry.messaging(omit_requirement_level,tag=tech-specific-servicebus) -->
| Attribute | Type | Description | Examples |
|---|---|---|---|
| `messaging.servicebus.destination.subscription_name` | string | The name of the subscription in the topic messages are received from. | `mySubscription` |
| `messaging.servicebus.message.delivery_count` | int | Number of deliveries that have been attempted for this message. | `2` |
| `messaging.servicebus.message.enqueued_time` | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` |
<!-- endsemconv -->
43 changes: 43 additions & 0 deletions docs/messaging/azure-messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Google Cloud Pub/Sub
--->

# Semantic Conventions for Azure Messaging systems

**Status**: [Experimental][DocumentStatus]

The Semantic Conventions for [Azure Service Bus](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview) and [Azure Event Hubs](https://learn.microsoft.com/azure/event-hubs/event-hubs-about) extend and override the [Messaging Semantic Conventions](README.md) that describe common messaging operations attributes in addition to the Semantic Conventions described on this page.

## Azure Service Bus

`messaging.system` MUST be set to `"servicebus"`.

### Span attributes

The following additional attributes are defined:
<!-- semconv messaging.servicebus -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`messaging.servicebus.destination.subscription_name`](../attributes-registry/messaging.md) | string | The name of the subscription in the topic messages are received from. | `mySubscription` | Conditionally Required: If messages are received from the subscription. |
| [`messaging.servicebus.message.delivery_count`](../attributes-registry/messaging.md) | int | Number of deliveries that have been attempted for this message. | `2` | Conditionally Required: [1] |
| [`messaging.servicebus.message.enqueued_time`](../attributes-registry/messaging.md) | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | Recommended |

**[1]:** If delivery count is available and is bigger than 0.
<!-- endsemconv -->

## Azure Event Hubs

`messaging.system` MUST be set to `"eventhubs"`.

### Span attributes

The following additional attributes are defined:
<!-- semconv messaging.eventhubs -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`messaging.eventhubs.consumer.group`](../attributes-registry/messaging.md) | string | The name of the consumer group the event consumer is associated with. | `indexer` | Conditionally Required: If not default ("$Default"). |
| [`messaging.eventhubs.destination.partition.id`](../attributes-registry/messaging.md) | string | The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it. | `1` | Conditionally Required: If available. |
| [`messaging.eventhubs.message.enqueued_time`](../attributes-registry/messaging.md) | int | The UTC epoch seconds at which the message has been accepted and stored in the entity. | `1701393730` | Recommended |
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
6 changes: 3 additions & 3 deletions docs/messaging/messaging-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi
|---|---|
| `activemq` | Apache ActiveMQ |
| `aws_sqs` | Amazon Simple Queue Service (SQS) |
| `azure_eventgrid` | Azure Event Grid |
| `azure_eventhubs` | Azure Event Hubs |
| `azure_servicebus` | Azure Service Bus |
| `eventgrid` | Azure Event Grid |
| `eventhubs` | Azure Event Hubs |
| `servicebus` | Azure Service Bus |
| `gcp_pubsub` | Google Cloud Pub/Sub |
| `jms` | Java Message Service |
| `kafka` | Apache Kafka |
Expand Down
6 changes: 3 additions & 3 deletions docs/messaging/messaging-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ different processes could be listening on TCP port 12345 and UDP port 12345.
|---|---|
| `activemq` | Apache ActiveMQ |
| `aws_sqs` | Amazon Simple Queue Service (SQS) |
| `azure_eventgrid` | Azure Event Grid |
| `azure_eventhubs` | Azure Event Hubs |
| `azure_servicebus` | Azure Service Bus |
| `eventgrid` | Azure Event Grid |
| `eventhubs` | Azure Event Hubs |
| `servicebus` | Azure Service Bus |
| `gcp_pubsub` | Google Cloud Pub/Sub |
| `jms` | Java Message Service |
| `kafka` | Apache Kafka |
Expand Down
48 changes: 42 additions & 6 deletions model/registry/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ groups:
- id: aws_sqs
value: 'aws_sqs'
brief: 'Amazon Simple Queue Service (SQS)'
- id: azure_eventgrid
value: 'azure_eventgrid'
- id: eventgrid
value: 'eventgrid'
brief: 'Azure Event Grid'
- id: azure_eventhubs
value: 'azure_eventhubs'
- id: eventhubs
value: 'eventhubs'
brief: 'Azure Event Hubs'
- id: azure_servicebus
value: 'azure_servicebus'
- id: servicebus
value: 'servicebus'
brief: 'Azure Service Bus'
- id: gcp_pubsub
value: 'gcp_pubsub'
Expand All @@ -273,3 +273,39 @@ groups:
value: 'rocketmq'
brief: 'Apache RocketMQ'
tag: messaging-generic
- id: servicebus.message.delivery_count
type: int
brief: >
Number of deliveries that have been attempted for this message.
examples: 2
tag: tech-specific-servicebus
- id: servicebus.message.enqueued_time
type: int
brief: >
The UTC epoch seconds at which the message has been accepted and stored in the entity.
examples: 1701393730
tag: tech-specific-servicebus
- id: servicebus.destination.subscription_name
type: string
brief: >
The name of the subscription in the topic messages are received from.
examples: "mySubscription"
tag: tech-specific-servicebus
- id: eventhubs.message.enqueued_time
type: int
brief: >
The UTC epoch seconds at which the message has been accepted and stored in the entity.
examples: 1701393730
tag: tech-specific-eventhubs
- id: eventhubs.destination.partition.id
type: string
brief: >
The identifier of the partition messages are sent to or received from, unique to the Event Hub which contains it.
examples: '1'
tag: tech-specific-eventhubs
- id: eventhubs.consumer.group
type: string
brief: >
The name of the consumer group the event consumer is associated with.
examples: 'indexer'
tag: tech-specific-eventhubs
26 changes: 26 additions & 0 deletions model/trace/messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,29 @@ groups:
tag: tech-specific-gcp-pubsub
requirement_level:
conditionally_required: If the message type has an ordering key set.
- id: messaging.servicebus
type: attribute_group
extends: messaging
brief: >
Attributes for Azure Service Bus
attributes:
- ref: messaging.servicebus.message.delivery_count
requirement_level:
conditionally_required: If delivery count is available and is bigger than 0.
- ref: messaging.servicebus.message.enqueued_time
- ref: messaging.servicebus.destination.subscription_name
requirement_level:
conditionally_required: If messages are received from the subscription.
- id: messaging.eventhubs
type: attribute_group
extends: messaging
brief: >
Attributes for Azure Event Hubs
attributes:
- ref: messaging.eventhubs.message.enqueued_time
- ref: messaging.eventhubs.destination.partition.id
requirement_level:
conditionally_required: If available.
- ref: messaging.eventhubs.consumer.group
requirement_level:
conditionally_required: If not default ("$Default").
Loading