From 48881dafc3e0bc6b41a67a885190b3acce8e816f Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 2 Feb 2024 14:29:35 -0800 Subject: [PATCH 1/8] Add Azure messaging metric overrides --- docs/messaging/azure-messaging.md | 215 +++++++++++++++++++++++++++- docs/messaging/messaging-metrics.md | 6 +- model/trace/messaging.yaml | 51 +++++++ 3 files changed, 263 insertions(+), 9 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 35e17ec2c3..5ddd297aa2 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -12,32 +12,235 @@ The Semantic Conventions for [Azure Service Bus](https://learn.microsoft.com/azu `messaging.system` MUST be set to `"servicebus"`. -### Span attributes +### Attributes -The following additional attributes are defined: +The following attributes are defined or reused: | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| +| [`error.type`](../attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:resource-limit-exceeded`; `com.microsoft:message-lock-lost`; `503`; `System.OperationCanceledException` | Conditionally Required: [2] | +| [`messaging.batch.message_count`](../attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [3] | `0`; `1`; `2` | Conditionally Required: [4] | +| [`messaging.destination.name`](../attributes-registry/messaging.md) | string | The message destination name [5] | `MyQueue`; `MyTopic` | Conditionally Required: [6] | +| [`messaging.message.conversation_id`](../attributes-registry/messaging.md) | string | Service Bus [Session Id](https://learn.microsoft.com/azure/service-bus-messaging/message-sessions) | `MyConversationId` | Recommended | +| [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | +| [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [7] | `publish` | Required | | [`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.delivery_count`](../attributes-registry/messaging.md) | int | Number of deliveries that have been attempted for this message. | `2` | Conditionally Required: [8] | | [`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 | +| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [9] | `amqp` | Conditionally Required: If not default (`amqp`). | +| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [10] | `1.0` | Conditionally Required: If not default (`1.0`). | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [12] | `5672` | Conditionally Required: If not default (`5672`). | -**[1]:** If delivery count is available and is bigger than 0. +**[1]:** When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). Otherwise SHOULD match full name of the exception type. + +**[2]:** If and only if the messaging operation has failed. + +**[3]:** Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + +**[4]:** If the span describes an operation on a batch of messages. + +**[5]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If +the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. + +**[6]:** If span describes operation on a single message or if the value applies to all messages in the batch. + +**[7]:** If a custom value is used, it MUST be of low cardinality. + +**[8]:** If delivery count is available and is bigger than 0. + +**[9]:** The value SHOULD be normalized to lowercase. + +**[10]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[11]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. + +**[12]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +### Metrics + +### Metric: `messaging.publish.duration` + +Measures time it takes to publish message or a batch of messages to Azure Service Bus including all retries. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. + +### Metric: `messaging.publish.messages` + +Measures the number of published messages. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.messages](./messaging-metrics.md#metric-messagingpublishmessages) definition. + +### Metric: `messaging.deliver.duration` + +Measures duration of processor client callback that processes a message. + +This metric is [required][MetricRequired] when processor client is used by the application. + +This metric follows the common [messaging.deliver.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +Notes: + +- Azure ServiceBus client libraries don't provide batch processing clients, therefore processed message count can be derived from `messaging.deliver.duration` metric and is not reported. +- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: + * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions + +### Metric: `messaging.receive.duration` + +Measures duration of receiver client call that receives (or awaits) messages. + +This metric is [required][MetricRequired] when receiver client is used by the application directly and when receive method is called to get a message/batch of messages. +When receiver client is called once to get unbounded stream of messages (for example when using [ServiceBusReceiverAsyncClient](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReceiveMessageAsyncSample.java)), this metric MUST NOT be reported. + +This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: + * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions + +### Metric: `messaging.receive.messages` + +Measures the number of received messages. + +This metric is [required][MetricRequired] when receiver client is used by the application directly. + +This metric follows the common [messaging.receive.messages](./messaging-metrics.md#metric-messagingreceivemessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: + * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions + ## Azure Event Hubs `messaging.system` MUST be set to `"eventhubs"`. -### Span attributes +### Attributes -The following additional attributes are defined: +The following attributes are defined or overridden: | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| +| [`error.type`](../attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `amqp:resource-limit-exceeded`; `com.microsoft:server-busy`; `503`; `System.OperationCanceledException` | Conditionally Required: [2] | +| [`messaging.batch.message_count`](../attributes-registry/messaging.md) | int | The number of messages sent, received, or processed in the scope of the batching operation. [3] | `0`; `1`; `2` | Conditionally Required: [4] | +| [`messaging.destination.name`](../attributes-registry/messaging.md) | string | The message destination name [5] | `MyQueue`; `MyTopic` | Conditionally Required: [6] | | [`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 | +| [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | +| [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [7] | `publish` | Required | +| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [8] | `amqp` | Conditionally Required: If not default (`amqp`). | +| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [9] | `1.0` | Conditionally Required: If not default (`1.0`). | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [11] | `5672` | Conditionally Required: If not default (`5672`). | + +**[1]:** When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). Otherwise SHOULD match full name of the exception type. + +**[2]:** If and only if the messaging operation has failed. + +**[3]:** Instrumentations SHOULD NOT set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations SHOULD use `messaging.batch.message_count` for batching APIs and SHOULD NOT use it for single-message APIs. + +**[4]:** If the span describes an operation on a batch of messages. + +**[5]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If +the broker doesn't have such notion, the destination name SHOULD uniquely identify the broker. + +**[6]:** If span describes operation on a single message or if the value applies to all messages in the batch. + +**[7]:** If a custom value is used, it MUST be of low cardinality. + +**[8]:** The value SHOULD be normalized to lowercase. + +**[9]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. + +**[10]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. + +**[11]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +### Metrics + +### Metric: `messaging.publish.duration` + +Measures time it takes to publish event or a batch of events to Azure Event Hubs including all retries. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. + +### Metric: `messaging.publish.messages` + +Measures the number of published events. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.messages](./messaging-metrics.md#metric-messagingpublishmessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Event Hubs Bus instrumentation SHOULD report following attributes: + * `messaging.eventhubs.destination.partition.id` when partition Id is provided to the producer client by the application. + +### Metric: `messaging.deliver.duration` + +Measures duration of processor client callback that processes an event or a batch of events. + +This metric is [required][MetricRequired] when processor client is used by the application. + +This metric follows the common [messaging.deliver.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: + * `messaging.eventhubs.destination.partition.id` + * `messaging.eventhubs.consumer.group` + +### Metric: `messaging.deliver.messages` + +This metric is [required][MetricRequired] when processor client is used by the application. + +This metric follows the common [messaging.deliver.messages](./messaging-metrics.md#metric-messagingdelivermessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: + * `messaging.eventhubs.destination.partition.id` + * `messaging.eventhubs.consumer.group` + +### Metric: `messaging.receive.duration` + +Measures duration of consumer client call that receives (or awaits) events. + +This metric is [required][MetricRequired] when consumer client is used by the application directly and when receive method is called to get an event/batch of event. +When consumer client is called once to get unbounded stream of events (for example when using [EventHubConsumerAsyncClient](https://github.com/Azure/azure-sdk-for-java/blob/4587bbec4ceab1e669842155baa8546680134d61/sdk/eventhubs/azure-messaging-eventhubs/README.md#consume-events-with-eventhubconsumerasyncclient)), this metric MUST NOT be reported. + +This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: + * `messaging.eventhubs.destination.partition.id` + * `messaging.eventhubs.consumer.group` + +### Metric: `messaging.receive.messages` + +Measures the number of received events. + +This metric is [required][MetricRequired] when receiver client is used by the application directly. + +This metric follows the common [messaging.receive.messages](./messaging-metrics.md#metric-messagingreceivemessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: + * `messaging.eventhubs.destination.partition.id` + * `messaging.eventhubs.consumer.group` + [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required diff --git a/docs/messaging/messaging-metrics.md b/docs/messaging/messaging-metrics.md index dc9d1ef9b0..e35d0495c0 100644 --- a/docs/messaging/messaging-metrics.md +++ b/docs/messaging/messaging-metrics.md @@ -179,6 +179,6 @@ _Note: The need to report `messaging.deliver.messages` depends on the messaging | `messaging.deliver.messages` | Counter | `{message}` | Measures the number of delivered messages. | -[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md -[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/metric-requirement-level.md#required -[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/metric-requirement-level.md#opt-in +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/document-status.md +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required +[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index cc980de321..47b72c760e 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -177,6 +177,33 @@ groups: - ref: messaging.servicebus.destination.subscription_name requirement_level: conditionally_required: If messages are received from the subscription. + - ref: network.protocol.name + requirement_level: + conditionally_required: If not default (`amqp`). + examples: ["amqp"] + - ref: network.protocol.version + requirement_level: + conditionally_required: If not default (`1.0`). + examples: ["1.0"] + - ref: server.port + requirement_level: + conditionally_required: If not default (`5672`). + examples: ["5672"] + - ref: error.type + note: > + When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or + string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). + Otherwise SHOULD match full name of the exception type. + examples: + ["amqp:resource-limit-exceeded", "com.microsoft:message-lock-lost", "503", "System.OperationCanceledException"] + - ref: messaging.batch.message_count + - ref: messaging.destination.name + - ref: messaging.message.conversation_id + brief: Service Bus [Session Id](https://learn.microsoft.com/azure/service-bus-messaging/message-sessions) + - ref: messaging.message.id + - ref: messaging.operation + - ref: server.address + - id: messaging.eventhubs type: attribute_group extends: messaging @@ -190,3 +217,27 @@ groups: - ref: messaging.eventhubs.consumer.group requirement_level: conditionally_required: If not default ("$Default"). + - ref: network.protocol.name + requirement_level: + conditionally_required: If not default (`amqp`). + examples: ["amqp"] + - ref: network.protocol.version + requirement_level: + conditionally_required: If not default (`1.0`). + examples: ["1.0"] + - ref: server.port + requirement_level: + conditionally_required: If not default (`5672`). + examples: ["5672"] + - ref: error.type + note: > + When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or + string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). + Otherwise SHOULD match full name of the exception type. + examples: + ["amqp:resource-limit-exceeded", "com.microsoft:server-busy", "503", "System.OperationCanceledException"] + - ref: messaging.batch.message_count + - ref: messaging.destination.name + - ref: messaging.message.id + - ref: messaging.operation + - ref: server.address \ No newline at end of file From 331e2d0817671615708a6e942ecc0b6c521e14f0 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 2 Feb 2024 14:47:32 -0800 Subject: [PATCH 2/8] Add kafka metric overrides --- docs/messaging/azure-messaging.md | 24 ++++++------ docs/messaging/gcp-pubsub.md | 4 +- docs/messaging/kafka.md | 61 ++++++++++++++++++++++++++++++- 3 files changed, 73 insertions(+), 16 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 5ddd297aa2..0800787bd8 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -60,7 +60,7 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi ### Metrics -### Metric: `messaging.publish.duration` +#### Metric: `messaging.publish.duration` Measures time it takes to publish message or a batch of messages to Azure Service Bus including all retries. @@ -68,7 +68,7 @@ This metric is [required][MetricRequired] This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. -### Metric: `messaging.publish.messages` +#### Metric: `messaging.publish.messages` Measures the number of published messages. @@ -76,7 +76,7 @@ This metric is [required][MetricRequired] This metric follows the common [messaging.publish.messages](./messaging-metrics.md#metric-messagingpublishmessages) definition. -### Metric: `messaging.deliver.duration` +#### Metric: `messaging.deliver.duration` Measures duration of processor client callback that processes a message. @@ -84,13 +84,13 @@ This metric is [required][MetricRequired] when processor client is used by the a This metric follows the common [messaging.deliver.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. -Notes: +**Notes:** - Azure ServiceBus client libraries don't provide batch processing clients, therefore processed message count can be derived from `messaging.deliver.duration` metric and is not reported. - In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions -### Metric: `messaging.receive.duration` +#### Metric: `messaging.receive.duration` Measures duration of receiver client call that receives (or awaits) messages. @@ -104,7 +104,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. - In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions -### Metric: `messaging.receive.messages` +#### Metric: `messaging.receive.messages` Measures the number of received messages. @@ -166,7 +166,7 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi ### Metrics -### Metric: `messaging.publish.duration` +#### Metric: `messaging.publish.duration` Measures time it takes to publish event or a batch of events to Azure Event Hubs including all retries. @@ -174,7 +174,7 @@ This metric is [required][MetricRequired] This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. -### Metric: `messaging.publish.messages` +#### Metric: `messaging.publish.messages` Measures the number of published events. @@ -187,7 +187,7 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. - In addition to generic attributes defined for the metric, Event Hubs Bus instrumentation SHOULD report following attributes: * `messaging.eventhubs.destination.partition.id` when partition Id is provided to the producer client by the application. -### Metric: `messaging.deliver.duration` +#### Metric: `messaging.deliver.duration` Measures duration of processor client callback that processes an event or a batch of events. @@ -201,7 +201,7 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` -### Metric: `messaging.deliver.messages` +#### Metric: `messaging.deliver.messages` This metric is [required][MetricRequired] when processor client is used by the application. @@ -213,7 +213,7 @@ This metric follows the common [messaging.deliver.messages](./messaging-metrics. * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` -### Metric: `messaging.receive.duration` +#### Metric: `messaging.receive.duration` Measures duration of consumer client call that receives (or awaits) events. @@ -228,7 +228,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` -### Metric: `messaging.receive.messages` +#### Metric: `messaging.receive.messages` Measures the number of received events. diff --git a/docs/messaging/gcp-pubsub.md b/docs/messaging/gcp-pubsub.md index 95acf97d64..fd12cd569e 100644 --- a/docs/messaging/gcp-pubsub.md +++ b/docs/messaging/gcp-pubsub.md @@ -10,7 +10,7 @@ The Semantic Conventions for [Google Cloud Pub/Sub](https://cloud.google.com/pub `messaging.system` MUST be set to `"gcp_pubsub"`. -## Span attributes +## Attributes For Google Cloud Pub/Sub, the following additional attributes are defined: @@ -31,7 +31,7 @@ flowchart LR; direction LR CA[Span Create A] CB[Span Create B] - P[Span Publish A B] + P[Span Publish A B] end CA-. link .-P; CB-. link .-P; diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index ffb30d89c2..d19ff98d48 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -20,7 +20,7 @@ described on this page. `messaging.system` MUST be set to `"kafka"`. -## Span attributes +## Attributes For Apache Kafka, the following additional attributes are defined: @@ -44,7 +44,63 @@ If an intermediary broker is present, `service.name` and `peer.service` will not `messaging.client_id` SHOULD be set to the `client-id` of consumers, or to the `client.id` property of producers. -## Examples +## Metrics + +### Metric: `messaging.publish.duration` + +Measures time it takes to publish message or a batch of messages to Apache Kafka including all retries. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: + * `messaging.kafka.destination.partition` + +### Metric: `messaging.publish.messages` + +Measures the number of published messages. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.messages](./messaging-metrics.md#metric-messagingpublishmessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: + * `messaging.kafka.destination.partition` + +### Metric: `messaging.receive.duration` + +Measures duration of receiver client call that polls messages. + +This metric is [required][MetricRequired]. + +This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: + * `messaging.kafka.destination.partition` + * `messaging.kafka.consumer.group` + +### Metric: `messaging.receive.messages` + +Measures the number of received messages. + +This metric is [required][MetricRequired]. + +This metric follows the common [messaging.receive.messages](./messaging-metrics.md#metric-messagingreceivemessages) definition. + +**Notes:** + +- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: + * `messaging.kafka.destination.partition` + * `messaging.kafka.consumer.group` + +## Span examples ### Apache Kafka with Quarkus or Spring Boot Example @@ -85,3 +141,4 @@ Process CB: | Span Rcv2 | | `messaging.kafka.message.offset` | `"12"` | `"12"` | `"12"` | `"32"` | `"32"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required \ No newline at end of file From 819573f81ea59cfd0b99a924c435764445efc21a Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 2 Feb 2024 15:05:52 -0800 Subject: [PATCH 3/8] Add RabbitMQ --- docs/messaging/azure-messaging.md | 2 +- docs/messaging/kafka.md | 2 +- docs/messaging/rabbitmq.md | 38 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 0800787bd8..be26066918 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -86,7 +86,7 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. **Notes:** -- Azure ServiceBus client libraries don't provide batch processing clients, therefore processed message count can be derived from `messaging.deliver.duration` metric and is not reported. +- Azure Service Bus client libraries don't provide batch processing clients, therefore count of processed messages can be derived from `messaging.deliver.duration` metric and is not reported. - In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index d19ff98d48..fc71678d88 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -74,7 +74,7 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. ### Metric: `messaging.receive.duration` -Measures duration of receiver client call that polls messages. +Measures duration of consumer client call that polls messages. This metric is [required][MetricRequired]. diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 1c762c4386..33344a5999 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -23,4 +23,42 @@ In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. | [`messaging.rabbitmq.destination.routing_key`](../attributes-registry/messaging.md) | string | RabbitMQ message routing key. | `myKey` | Conditionally Required: If not empty. | +## Metrics + +### Metric: `messaging.publish.duration` + +Measures time it takes to publish a message or a batch of messages to RabbitMQ including all retries. + +This metric is [required][MetricRequired] + +This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. + +**Notes:** +- `messaging.publish.messages` metric is not reported: RabbitMQ doesn't support batch publish, therefore the count of published messages can be derived from `messaging.publish.duration` metric. +- In addition to generic attributes defined for the metric, RabbitMQ instrumentation SHOULD report following attributes: + * `messaging.rabbitmq.destination.routing_key` + +### Metric: `messaging.deliver.duration` + +Measures duration of delivery callback that consumes a message. + +This metric is [required][MetricRequired] when consume API is used. + +This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** +- `messaging.deliver.messages` metric is not reported: RabbitMQ doesn't support batch consumption, therefore the count of delivered messages can be derived from `messaging.deliver.duration` metric. + +### Metric: `messaging.receive.duration` + +Measures duration of pull call. + +This metric is [required][MetricRequired] if pull API is used. + +This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. + +**Notes:** +- `messaging.receive.messages` metric is not reported: RabbitMQ doesn't support batch receive, therefore the count of received messages can be derived from `messaging.receive.duration` metric. + [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required \ No newline at end of file From 34f2d2e088477944c1a3880f7622680efda0eecf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 6 Feb 2024 16:25:23 -0800 Subject: [PATCH 4/8] review --- docs/messaging/azure-messaging.md | 28 ++++++++++++++-------------- docs/messaging/kafka.md | 8 ++++---- docs/messaging/rabbitmq.md | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index be26066918..6fa7d6ce14 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -12,7 +12,7 @@ The Semantic Conventions for [Azure Service Bus](https://learn.microsoft.com/azu `messaging.system` MUST be set to `"servicebus"`. -### Attributes +### Service Bus Attributes The following attributes are defined or reused: @@ -87,8 +87,8 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. **Notes:** - Azure Service Bus client libraries don't provide batch processing clients, therefore count of processed messages can be derived from `messaging.deliver.duration` metric and is not reported. -- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: - * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions +- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): + * `messaging.servicebus.destination.subscription_name` #### Metric: `messaging.receive.duration` @@ -101,8 +101,8 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: - * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions +- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): + * `messaging.servicebus.destination.subscription_name` #### Metric: `messaging.receive.messages` @@ -114,14 +114,14 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Service Bus instrumentation SHOULD report following attributes: - * `messaging.servicebus.destination.subscription_name` when processing messages from topic subscriptions +- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): + * `messaging.servicebus.destination.subscription_name` ## Azure Event Hubs `messaging.system` MUST be set to `"eventhubs"`. -### Attributes +### Event Hubs Attributes The following attributes are defined or overridden: @@ -184,8 +184,8 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs Bus instrumentation SHOULD report following attributes: - * `messaging.eventhubs.destination.partition.id` when partition Id is provided to the producer client by the application. +- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): + * `messaging.eventhubs.destination.partition.id` #### Metric: `messaging.deliver.duration` @@ -197,7 +197,7 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -209,7 +209,7 @@ This metric follows the common [messaging.deliver.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -224,7 +224,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -238,7 +238,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index fc71678d88..a4ce4aea01 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -56,7 +56,7 @@ This metric follows the common [messaging.publish.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): * `messaging.kafka.destination.partition` ### Metric: `messaging.publish.messages` @@ -69,7 +69,7 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): * `messaging.kafka.destination.partition` ### Metric: `messaging.receive.duration` @@ -82,7 +82,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): * `messaging.kafka.destination.partition` * `messaging.kafka.consumer.group` @@ -96,7 +96,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): * `messaging.kafka.destination.partition` * `messaging.kafka.consumer.group` diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 33344a5999..8cccbb8430 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -35,7 +35,7 @@ This metric follows the common [messaging.publish.duration](./messaging-metrics. **Notes:** - `messaging.publish.messages` metric is not reported: RabbitMQ doesn't support batch publish, therefore the count of published messages can be derived from `messaging.publish.duration` metric. -- In addition to generic attributes defined for the metric, RabbitMQ instrumentation SHOULD report following attributes: +- In addition to generic attributes defined for the metric, RabbitMQ instrumentations SHOULD report the following attributes (according to their [requirement levels](#rabbitmq-attributes)): * `messaging.rabbitmq.destination.routing_key` ### Metric: `messaging.deliver.duration` From 6b70542e027d96a5d20843053130890cc35db121 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 6 Feb 2024 16:38:05 -0800 Subject: [PATCH 5/8] lint --- docs/messaging/azure-messaging.md | 30 ++++++++++++++++++++++++++---- docs/messaging/kafka.md | 11 ++++++++--- docs/messaging/rabbitmq.md | 19 ++++++++++++++++--- model/trace/messaging.yaml | 2 +- 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 6fa7d6ce14..6757537221 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -1,11 +1,33 @@ -# Semantic Conventions for Azure Messaging systems +# Semantic Conventions for Azure Messaging Systems **Status**: [Experimental][DocumentStatus] + + +- [Azure Service Bus](#azure-service-bus) + * [Service Bus Attributes](#service-bus-attributes) + * [Service Bus Metrics](#service-bus-metrics) + + [Metric: `messaging.publish.duration`](#metric-messagingpublishduration) + + [Metric: `messaging.publish.messages`](#metric-messagingpublishmessages) + + [Metric: `messaging.deliver.duration`](#metric-messagingdeliverduration) + + [Metric: `messaging.receive.duration`](#metric-messagingreceiveduration) + + [Metric: `messaging.receive.messages`](#metric-messagingreceivemessages) +- [Azure Event Hubs](#azure-event-hubs) + * [Event Hubs Attributes](#event-hubs-attributes) + * [Event Hubs Metrics](#event-hubs-metrics) + + [Metric: `messaging.publish.duration`](#metric-messagingpublishduration-1) + + [Metric: `messaging.publish.messages`](#metric-messagingpublishmessages-1) + + [Metric: `messaging.deliver.duration`](#metric-messagingdeliverduration-1) + + [Metric: `messaging.deliver.messages`](#metric-messagingdelivermessages) + + [Metric: `messaging.receive.duration`](#metric-messagingreceiveduration-1) + + [Metric: `messaging.receive.messages`](#metric-messagingreceivemessages-1) + + + 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 @@ -58,7 +80,7 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[12]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -### Metrics +### Service Bus Metrics #### Metric: `messaging.publish.duration` @@ -164,7 +186,7 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[11]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. -### Metrics +### Event Hubs Metrics #### Metric: `messaging.publish.duration` diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index a4ce4aea01..ae35a94f99 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -8,7 +8,12 @@ linkTitle: Kafka -- [Span attributes](#span-attributes) +- [Attributes](#attributes) +- [Metrics](#metrics) + * [Metric: `messaging.publish.duration`](#metric-messagingpublishduration) + * [Metric: `messaging.publish.messages`](#metric-messagingpublishmessages) + * [Metric: `messaging.receive.duration`](#metric-messagingreceiveduration) + * [Metric: `messaging.receive.messages`](#metric-messagingreceivemessages) - [Examples](#examples) * [Apache Kafka with Quarkus or Spring Boot Example](#apache-kafka-with-quarkus-or-spring-boot-example) @@ -100,7 +105,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. * `messaging.kafka.destination.partition` * `messaging.kafka.consumer.group` -## Span examples +## Examples ### Apache Kafka with Quarkus or Spring Boot Example @@ -141,4 +146,4 @@ Process CB: | Span Rcv2 | | `messaging.kafka.message.offset` | `"12"` | `"12"` | `"12"` | `"32"` | `"32"` | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md -[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required \ No newline at end of file +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index 8cccbb8430..b0fe90e14a 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -6,13 +6,23 @@ linkTitle: RabbitMQ **Status**: [Experimental][DocumentStatus] + + +- [Attributes](#attributes) +- [Metrics](#metrics) + * [Metric: `messaging.publish.duration`](#metric-messagingpublishduration) + * [Metric: `messaging.deliver.duration`](#metric-messagingdeliverduration) + * [Metric: `messaging.receive.duration`](#metric-messagingreceiveduration) + + + The Semantic Conventions for [RabbitMQ](https://www.rabbitmq.com/) 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. `messaging.system` MUST be set to `"rabbitmq"`. -## RabbitMQ attributes +## Attributes In RabbitMQ, the destination is defined by an *exchange* and a *routing key*. `messaging.destination.name` MUST be set to the name of the exchange. This will be an empty string if the default exchange is used. @@ -34,8 +44,9 @@ This metric is [required][MetricRequired] This metric follows the common [messaging.publish.duration](./messaging-metrics.md#metric-messagingpublishduration) definition. **Notes:** + - `messaging.publish.messages` metric is not reported: RabbitMQ doesn't support batch publish, therefore the count of published messages can be derived from `messaging.publish.duration` metric. -- In addition to generic attributes defined for the metric, RabbitMQ instrumentations SHOULD report the following attributes (according to their [requirement levels](#rabbitmq-attributes)): +- In addition to generic attributes defined for the metric, RabbitMQ instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): * `messaging.rabbitmq.destination.routing_key` ### Metric: `messaging.deliver.duration` @@ -47,6 +58,7 @@ This metric is [required][MetricRequired] when consume API is used. This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. **Notes:** + - `messaging.deliver.messages` metric is not reported: RabbitMQ doesn't support batch consumption, therefore the count of delivered messages can be derived from `messaging.deliver.duration` metric. ### Metric: `messaging.receive.duration` @@ -58,7 +70,8 @@ This metric is [required][MetricRequired] if pull API is used. This metric follows the common [messaging.receive.duration](./messaging-metrics.md#metric-messagingdeliverduration) definition. **Notes:** + - `messaging.receive.messages` metric is not reported: RabbitMQ doesn't support batch receive, therefore the count of received messages can be derived from `messaging.receive.duration` metric. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md -[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required \ No newline at end of file +[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 47b72c760e..385062fbb6 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -240,4 +240,4 @@ groups: - ref: messaging.destination.name - ref: messaging.message.id - ref: messaging.operation - - ref: server.address \ No newline at end of file + - ref: server.address From bacd4143bd6b6e543038ff5720334050dfed8804 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Tue, 6 Feb 2024 16:55:32 -0800 Subject: [PATCH 6/8] changelog --- .chloggen/553.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chloggen/553.yaml diff --git a/.chloggen/553.yaml b/.chloggen/553.yaml new file mode 100644 index 0000000000..a7e224be5a --- /dev/null +++ b/.chloggen/553.yaml @@ -0,0 +1,7 @@ +change_type: enhancement + +component: messaging + +note: Extends generic messaging metrics for RabbitMQ, Kafka, and Azure messaging services + +issues: [553] From 2df3f172a7695ddfde8e19cd922948446dc25595 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 7 Feb 2024 14:20:14 -0800 Subject: [PATCH 7/8] review --- docs/messaging/azure-messaging.md | 18 +++++++++--------- docs/messaging/kafka.md | 8 ++++---- docs/messaging/rabbitmq.md | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 6757537221..1f7392f8d4 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -108,8 +108,8 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. **Notes:** -- Azure Service Bus client libraries don't provide batch processing clients, therefore count of processed messages can be derived from `messaging.deliver.duration` metric and is not reported. -- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): +- Azure Service Bus client libraries don't support batch processing, therefore the count of processed messages can be derived from the `messaging.deliver.duration` metric and is not reported. +- The following attributes (with corresponding [requirement levels](#service-bus-attributes)) are defined in addition to generic attributes for this metric: * `messaging.servicebus.destination.subscription_name` #### Metric: `messaging.receive.duration` @@ -123,7 +123,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): +- The following attributes (with corresponding [requirement levels](#service-bus-attributes)) are defined in addition to generic attributes for this metric: * `messaging.servicebus.destination.subscription_name` #### Metric: `messaging.receive.messages` @@ -136,7 +136,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Service Bus instrumentations SHOULD report the following attributes (according to their [requirement levels](#service-bus-attributes)): +- The following attributes (with corresponding [requirement levels](#service-bus-attributes)) are defined in addition to generic attributes for this metric: * `messaging.servicebus.destination.subscription_name` ## Azure Event Hubs @@ -206,7 +206,7 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): +- The following attributes (with corresponding [requirement levels](#event-hubs-attributes)) are defined in addition to generic attributes for this metric: * `messaging.eventhubs.destination.partition.id` #### Metric: `messaging.deliver.duration` @@ -219,7 +219,7 @@ This metric follows the common [messaging.deliver.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): +- The following attributes (with corresponding [requirement levels](#event-hubs-attributes)) are defined in addition to generic attributes for this metric: * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -231,7 +231,7 @@ This metric follows the common [messaging.deliver.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): +- The following attributes (with corresponding [requirement levels](#event-hubs-attributes)) are defined in addition to generic attributes for this metric: * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -246,7 +246,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): +- The following attributes (with corresponding [requirement levels](#event-hubs-attributes)) are defined in addition to generic attributes for this metric: * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` @@ -260,7 +260,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Event Hubs instrumentations SHOULD report the following attributes (according to their [requirement levels](#event-hubs-attributes)): +- The following attributes (with corresponding [requirement levels](#event-hubs-attributes)) are defined in addition to generic attributes for this metric: * `messaging.eventhubs.destination.partition.id` * `messaging.eventhubs.consumer.group` diff --git a/docs/messaging/kafka.md b/docs/messaging/kafka.md index ae35a94f99..a753034b99 100644 --- a/docs/messaging/kafka.md +++ b/docs/messaging/kafka.md @@ -61,7 +61,7 @@ This metric follows the common [messaging.publish.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): +- The following attributes (with corresponding [requirement levels](#attributes)) are defined in addition to generic attributes for this metric: * `messaging.kafka.destination.partition` ### Metric: `messaging.publish.messages` @@ -74,7 +74,7 @@ This metric follows the common [messaging.publish.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): +- The following attributes (with corresponding [requirement levels](#attributes)) are defined in addition to generic attributes for this metric: * `messaging.kafka.destination.partition` ### Metric: `messaging.receive.duration` @@ -87,7 +87,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): +- The following attributes (with corresponding [requirement levels](#attributes)) are defined in addition to generic attributes for this metric: * `messaging.kafka.destination.partition` * `messaging.kafka.consumer.group` @@ -101,7 +101,7 @@ This metric follows the common [messaging.receive.messages](./messaging-metrics. **Notes:** -- In addition to generic attributes defined for the metric, Apache Kafka instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): +- The following attributes (with corresponding [requirement levels](#attributes)) are defined in addition to generic attributes for this metric: * `messaging.kafka.destination.partition` * `messaging.kafka.consumer.group` diff --git a/docs/messaging/rabbitmq.md b/docs/messaging/rabbitmq.md index b0fe90e14a..f9ee8b6151 100644 --- a/docs/messaging/rabbitmq.md +++ b/docs/messaging/rabbitmq.md @@ -45,8 +45,8 @@ This metric follows the common [messaging.publish.duration](./messaging-metrics. **Notes:** -- `messaging.publish.messages` metric is not reported: RabbitMQ doesn't support batch publish, therefore the count of published messages can be derived from `messaging.publish.duration` metric. -- In addition to generic attributes defined for the metric, RabbitMQ instrumentations SHOULD report the following attributes (according to their [requirement levels](#attributes)): +- `messaging.publish.messages` metric is not reported: RabbitMQ doesn't support batch publish, therefore the count of published messages can be derived from the `messaging.publish.duration` metric. +- The following attributes (with corresponding [requirement levels](#attributes)) are defined in addition to generic attributes for this metric: * `messaging.rabbitmq.destination.routing_key` ### Metric: `messaging.deliver.duration` @@ -71,7 +71,7 @@ This metric follows the common [messaging.receive.duration](./messaging-metrics. **Notes:** -- `messaging.receive.messages` metric is not reported: RabbitMQ doesn't support batch receive, therefore the count of received messages can be derived from `messaging.receive.duration` metric. +- `messaging.receive.messages` metric is not reported: RabbitMQ doesn't support batch receive, therefore the count of received messages can be derived the from `messaging.receive.duration` metric. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md [MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#required From 5e35de8cc3da6b200918f8acb399177fc3724e21 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 7 Feb 2024 19:03:21 -0800 Subject: [PATCH 8/8] remove network --- docs/messaging/azure-messaging.md | 28 ++++++++-------------------- model/trace/messaging.yaml | 16 ---------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/docs/messaging/azure-messaging.md b/docs/messaging/azure-messaging.md index 1f7392f8d4..29089fc9e6 100644 --- a/docs/messaging/azure-messaging.md +++ b/docs/messaging/azure-messaging.md @@ -49,10 +49,8 @@ The following attributes are defined or reused: | [`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: [8] | | [`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 | -| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [9] | `amqp` | Conditionally Required: If not default (`amqp`). | -| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [10] | `1.0` | Conditionally Required: If not default (`1.0`). | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [12] | `5672` | Conditionally Required: If not default (`5672`). | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [10] | `5672` | Conditionally Required: If not default (`5672`). | **[1]:** When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). Otherwise SHOULD match full name of the exception type. @@ -71,13 +69,9 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[8]:** If delivery count is available and is bigger than 0. -**[9]:** The value SHOULD be normalized to lowercase. +**[9]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. -**[10]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -**[11]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. - -**[12]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[10]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. ### Service Bus Metrics @@ -157,10 +151,8 @@ The following attributes are defined or overridden: | [`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 | | [`messaging.message.id`](../attributes-registry/messaging.md) | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | Recommended | | [`messaging.operation`](../attributes-registry/messaging.md) | string | A string identifying the kind of messaging operation. [7] | `publish` | Required | -| [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [8] | `amqp` | Conditionally Required: If not default (`amqp`). | -| [`network.protocol.version`](../attributes-registry/network.md) | string | Version of the protocol specified in `network.protocol.name`. [9] | `1.0` | Conditionally Required: If not default (`1.0`). | -| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [10] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | -| [`server.port`](../attributes-registry/server.md) | int | Server port number. [11] | `5672` | Conditionally Required: If not default (`5672`). | +| [`server.address`](../attributes-registry/server.md) | string | Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. [8] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | Conditionally Required: If available. | +| [`server.port`](../attributes-registry/server.md) | int | Server port number. [9] | `5672` | Conditionally Required: If not default (`5672`). | **[1]:** When available, SHOULD match [AMQP error condition](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-error) or string representation of a [management response status code](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response). Otherwise SHOULD match full name of the exception type. @@ -177,13 +169,9 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[7]:** If a custom value is used, it MUST be of low cardinality. -**[8]:** The value SHOULD be normalized to lowercase. - -**[9]:** `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - -**[10]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. +**[8]:** This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. -**[11]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. +**[9]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. ### Event Hubs Metrics diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 385062fbb6..26c36b9f53 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -177,14 +177,6 @@ groups: - ref: messaging.servicebus.destination.subscription_name requirement_level: conditionally_required: If messages are received from the subscription. - - ref: network.protocol.name - requirement_level: - conditionally_required: If not default (`amqp`). - examples: ["amqp"] - - ref: network.protocol.version - requirement_level: - conditionally_required: If not default (`1.0`). - examples: ["1.0"] - ref: server.port requirement_level: conditionally_required: If not default (`5672`). @@ -217,14 +209,6 @@ groups: - ref: messaging.eventhubs.consumer.group requirement_level: conditionally_required: If not default ("$Default"). - - ref: network.protocol.name - requirement_level: - conditionally_required: If not default (`amqp`). - examples: ["amqp"] - - ref: network.protocol.version - requirement_level: - conditionally_required: If not default (`1.0`). - examples: ["1.0"] - ref: server.port requirement_level: conditionally_required: If not default (`5672`).