diff --git a/.chloggen/1241.yaml b/.chloggen/1241.yaml new file mode 100644 index 0000000000..a3af4264c3 --- /dev/null +++ b/.chloggen/1241.yaml @@ -0,0 +1,4 @@ +change_type: breaking +component: messaging +note: Deprecate `messaging.destination_publish.*`` namespace and remove all usages. +issues: [ 1178, 1241 ] diff --git a/docs/attributes-registry/messaging.md b/docs/attributes-registry/messaging.md index e670a5e58f..47fff29b16 100644 --- a/docs/attributes-registry/messaging.md +++ b/docs/attributes-registry/messaging.md @@ -30,15 +30,13 @@ Attributes describing telemetry around messaging systems and messaging activitie | `messaging.destination.subscription.name` | string | The name of the destination subscription from which a message is consumed. [4] | `subscription-a` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [5] | `/customers/{customerId}` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.destination.temporary` | boolean | A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.destination_publish.anonymous` | boolean | A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.destination_publish.name` | string | The name of the original destination the message was published to [6] | `MyQueue`; `MyTopic` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.message.body.size` | int | The size of the message body in bytes. [7] | `1439` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.message.body.size` | int | The size of the message body in bytes. [6] | `1439` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.message.conversation_id` | string | The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". | `MyConversationId` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.message.envelope.size` | int | The size of the message body and metadata in bytes. [8] | `2738` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.message.envelope.size` | int | The size of the message body and metadata in bytes. [7] | `2738` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.message.id` | string | A value used by the messaging system as an identifier for the message, represented as a string. | `452a7c7c7c7048c2f887f61572b18fc2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.operation.name` | string | The system-specific name of the messaging operation. | `ack`; `nack`; `send` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.operation.type` | string | A string identifying the type of the messaging operation. [9] | `publish`; `create`; `receive` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `messaging.system` | string | The messaging system as identified by the client instrumentation. [10] | `activemq`; `aws_sqs`; `eventgrid` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.operation.type` | string | A string identifying the type of the messaging operation. [8] | `publish`; `create`; `receive` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.system` | string | The messaging system as identified by the client instrumentation. [9] | `activemq`; `aws_sqs`; `eventgrid` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** 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. @@ -51,18 +49,15 @@ the broker doesn't have such notion, the destination name SHOULD uniquely identi **[5]:** Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. -**[6]:** The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If -the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. - -**[7]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed +**[6]:** This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed body size should be used. -**[8]:** This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed +**[7]:** This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed size should be used. -**[9]:** If a custom value is used, it MUST be of low cardinality. +**[8]:** If a custom value is used, it MUST be of low cardinality. -**[10]:** The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. +**[9]:** The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. `messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -116,11 +111,11 @@ This group describes attributes specific to Apache Kafka. | Attribute | Type | Description | Examples | Stability | | ----------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------- | -| `messaging.kafka.message.key` | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [11] | `myKey` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `messaging.kafka.message.key` | string | Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. [10] | `myKey` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.kafka.message.tombstone` | boolean | A boolean that is true if the message is a tombstone. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `messaging.kafka.offset` | int | The offset of a record in the corresponding Kafka partition. | `42` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[11]:** If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. +**[10]:** If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. ## RabbitMQ Attributes @@ -185,13 +180,15 @@ This group describes attributes specific to Azure Service Bus. Describes deprecated messaging attributes. -| Attribute | Type | Description | Examples | Stability | -| ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `messaging.client_id` | string | Deprecated, use `messaging.client.id` instead. | `client-5`; `myhost@8742@s8083jm` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.client.id`. | -| `messaging.eventhubs.consumer.group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `$Default` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name`. | -| `messaging.kafka.consumer.group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `my-group` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name`. | -| `messaging.kafka.destination.partition` | int | Deprecated, use `messaging.destination.partition.id` instead. | `2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.destination.partition.id`. | -| `messaging.kafka.message.offset` | int | Deprecated, use `messaging.kafka.offset` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.kafka.offset`. | -| `messaging.operation` | string | Deprecated, use `messaging.operation.type` instead. | `publish`; `create`; `process` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.operation.type`. | -| `messaging.rocketmq.client_group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `myConsumerGroup` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name` on the consumer spans. No replacement for producer spans. | -| `messaging.servicebus.destination.subscription_name` | string | Deprecated, use `messaging.servicebus.destination.subscription_name` instead. | `subscription-a` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.servicebus.destination.subscription_name`. | +| Attribute | Type | Description | Examples | Stability | +| ---------------------------------------------------- | ------- | ----------------------------------------------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `messaging.client_id` | string | Deprecated, use `messaging.client.id` instead. | `client-5`; `myhost@8742@s8083jm` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.client.id`. | +| `messaging.destination_publish.anonymous` | boolean | Deprecated, no replacement at this time. | | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | +| `messaging.destination_publish.name` | string | Deprecated, no replacement at this time. | `MyQueue`; `MyTopic` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
No replacement at this time. | +| `messaging.eventhubs.consumer.group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `$Default` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name`. | +| `messaging.kafka.consumer.group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `my-group` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name`. | +| `messaging.kafka.destination.partition` | int | Deprecated, use `messaging.destination.partition.id` instead. | `2` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.destination.partition.id`. | +| `messaging.kafka.message.offset` | int | Deprecated, use `messaging.kafka.offset` instead. | `42` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.kafka.offset`. | +| `messaging.operation` | string | Deprecated, use `messaging.operation.type` instead. | `publish`; `create`; `process` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.operation.type`. | +| `messaging.rocketmq.client_group` | string | Deprecated, use `messaging.consumer.group.name` instead. | `myConsumerGroup` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.consumer.group.name` on the consumer spans. No replacement for producer spans. | +| `messaging.servicebus.destination.subscription_name` | string | Deprecated, use `messaging.servicebus.destination.subscription_name` instead. | `subscription-a` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
Replaced by `messaging.servicebus.destination.subscription_name`. | diff --git a/docs/messaging/messaging-spans.md b/docs/messaging/messaging-spans.md index 0855774bcf..d2d00ae79e 100644 --- a/docs/messaging/messaging-spans.md +++ b/docs/messaging/messaging-spans.md @@ -26,7 +26,6 @@ - [Producer spans](#producer-spans) - [Consumer spans](#consumer-spans) - [Messaging attributes](#messaging-attributes) - - [Consumer attributes](#consumer-attributes) - [Recording per-message attributes on batch operations](#recording-per-message-attributes-on-batch-operations) - [Examples](#examples) - [Topic with multiple consumers](#topic-with-multiple-consumers) @@ -89,12 +88,6 @@ A destination is usually uniquely identified by its name within the messaging system instance. Examples of a destination name would be an URL or a simple one-word identifier. -In some use cases, messages are routed within one or multiple brokers. In such -cases, the destination the message was originally published to is different -from the destination it is being consumed from. When information about the -destination where the message was originally published to is available, consumers -can record them under the `destination_publish` namespace. - Typical examples of destinations include Kafka topics, RabbitMQ queues and topics. ### Message consumption @@ -288,9 +281,8 @@ Messaging attributes are organized into the following namespaces: - `messaging.message`: Contains attributes that describe individual messages. - `messaging.destination`: Contains attributes that describe the logical entity messages are published to. See [Destinations](#destinations) for more details. -- `messaging.destination_publish`: Contains attributes that describe the logical entity messages were originally published to. See [Destinations](#destinations) for more details. - `messaging.batch`: Contains attributes that describe batch operations. -- `messaging.consumer`: Contains [consumer attributes](#consumer-attributes) that describe the application instance that consumes a message. See [consumer](#consumer) for more details. +- `messaging.consumer`: Contains attributes that describe the application instance that consumes a message. See [Consumer](#consumer) for more details. Messaging system-specific attributes MUST be defined in the corresponding `messaging.{system}` namespace. @@ -436,45 +428,6 @@ and SHOULD be provided **at span creation time** (if provided at all): - - - - - -### Consumer attributes - -The following additional attributes describe message consumer operations. - -Since messages could be routed by brokers, the destination messages are published -to may not match with the destination they are consumed from. - -If information about the original destination is available on the consumer, -consumer instrumentations SHOULD populate the attributes -under the namespace `messaging.destination_publish.*` - - - - - - - - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`messaging.destination_publish.anonymous`](/docs/attributes-registry/messaging.md) | boolean | A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name). | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`messaging.destination_publish.name`](/docs/attributes-registry/messaging.md) | string | The name of the original destination the message was published to [1] | `MyQueue`; `MyTopic` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If -the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. - - - -The following attributes can be important for making sampling decisions -and SHOULD be provided **at span creation time** (if provided at all): - -* [`messaging.destination_publish.name`](/docs/attributes-registry/messaging.md) - - diff --git a/model/registry/deprecated/messaging.yaml b/model/registry/deprecated/messaging.yaml index f7144862db..8054a9e1ae 100644 --- a/model/registry/deprecated/messaging.yaml +++ b/model/registry/deprecated/messaging.yaml @@ -65,3 +65,14 @@ groups: examples: 42 deprecated: > Replaced by `messaging.kafka.offset`. + - id: messaging.destination_publish.anonymous + type: boolean + stability: experimental + brief: 'Deprecated, no replacement at this time.' + deprecated: "No replacement at this time." + - id: messaging.destination_publish.name + type: string + stability: experimental + brief: 'Deprecated, no replacement at this time.' + deprecated: "No replacement at this time." + examples: ['MyQueue', 'MyTopic'] diff --git a/model/registry/messaging.yaml b/model/registry/messaging.yaml index 7a06243fc4..f17e8cb5bd 100644 --- a/model/registry/messaging.yaml +++ b/model/registry/messaging.yaml @@ -65,18 +65,6 @@ groups: type: boolean stability: experimental brief: 'A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed.' - - id: destination_publish.anonymous - type: boolean - stability: experimental - brief: 'A boolean that is true if the publish message destination is anonymous (could be unnamed or have auto-generated name).' - - id: destination_publish.name - type: string - stability: experimental - brief: 'The name of the original destination the message was published to' - note: | - The name SHOULD uniquely identify a specific queue, topic, or other entity within the broker. If - the broker doesn't have such notion, the original destination name SHOULD uniquely identify the broker. - examples: ['MyQueue', 'MyTopic'] - id: destination.partition.id type: string stability: experimental diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index 0d3c9f067d..c429f7a542 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -1,25 +1,4 @@ groups: - - id: messaging.destination_publish - prefix: messaging.destination_publish - type: attribute_group - brief: > - Semantic convention for attributes that describe the publish messaging destination on broker. - The term Publish Destination refers to the destination the message was originally published to. - These attributes should be used on the consumer side when information about - the publish destination is available and different than the destination message are consumed from. - note: | - Publish destination attributes should be set on publish, receive, - or other spans describing messaging operations. - Destination attributes should be set when the messaging operation handles - single messages. When the operation handles a batch of messages, - the destination attributes should only be applied when the attribute value - applies to all messages in the batch. - In other cases, destination attributes may be set on links. - attributes: - - ref: messaging.destination_publish.name - sampling_relevant: true - - ref: messaging.destination_publish.anonymous - - id: attributes.messaging.trace.minimal type: attribute_group brief: >