From 828c7d518335274fe2b3b01049c7ec2791d8cc8a Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Wed, 7 Oct 2020 09:48:14 -0700 Subject: [PATCH 01/14] Initial semantic conventions for messaging metrics. #1014 --- .../metrics/semantic_conventions/messaging.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 specification/metrics/semantic_conventions/messaging.md diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md new file mode 100644 index 00000000000..560e1ab421b --- /dev/null +++ b/specification/metrics/semantic_conventions/messaging.md @@ -0,0 +1,68 @@ +# Semantic conventions for messaging system metrics + +The conventions described in this section are specific to messaging systems. When interactions with messaging systems occur, +metric events about those operations will be generated and reported, providing insight into those +operations. + +**Disclaimer:** These are initial messaging system metric instruments and labels, more may be added + in the future. + +## Definitions + +The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conventions/messaging.md#definitions) is a resource for the messaging system terminology used in this document. + +## Common Labels + +The following labels **SHOULD** be applied to all messaging metric instruments. + +| Label | Description | Example | Required | +|---|---|---|---| +| `messaging.system` | A string identifying the messaging system. | `kafka`
`rabbitmq`
`activemq` | Yes | +| `messaging.destination` | The message destination name. | `MyQueue`
`MyTopic` | Yes | +| `messaging.destination_kind` | The kind of message destination | `queue` | Conditional [1] | +| `messaging.temp_destination` | A boolean that is true if the message destination is temporary. | true | Conditional
If missing, it is assumed to be false. | +| `messaging.protocol` | The name of the transport protocol. | `AMQP`
`MQTT` | No | +| `messaging.protocol_version` | The version of the transport protocol. | `0.9.1` | No | +| `messaging.url` | Connection string. | `tibjmsnaming://localhost:7222`
`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No [2] | +| `net.peer.name` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | kafka-pool-us-east | No [2] | +| `net.peer.port` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 9092 | No [2] | +| `net.peer.ip` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 127.0.0.1 | No [2] | +| `net.transport` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | IP.TCP | No [2] | + +**[1]:** Required only if the message destination is either a `queue` or `topic`. + +**[2]** For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): + +* `messaging.url` +* `net.peer.name`, `net.peer.port`, `net.peer.ip`, `net.transport` + +## Send Message Metric Instruments + +The following metric instruments SHOULD be captured for every message send operation. + +| Name | Instrument | Units | Description | +|----------------------|---------------|--------------|-------------| +| `messaging.sent.messages` | Counter | messages | Sum of messages sent. | +| `messaging.sent.duration` | ValueRecorder | milliseconds | Time spent sending a message. | +| `messaging.sent.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.sent.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | + +## Receive Message Metric Instruments + +The following metric instruments SHOULD be captured for every message receive operation. + +| Name | Instrument | Units | Description | +|----------------------|---------------|--------------|-------------| +| `messaging.received.messages` | Counter | messages | Sum of messages received. | +| `messaging.received.duration` | ValueRecorder | milliseconds | Time spent receiving a message or batch if batching messages. | +| `messaging.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.received.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | + +## Process Message Metric Instruments + +The following metric instruments SHOULD be captured for every message process operation. + +| Name | Instrument | Units | Description | +|----------------------|---------------|--------------|-------------| +| `messaging.processed.messages` | Counter | messages | Sum of messages processed. | +| `messaging.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | From edf4012a9aa71178aa89812a3636ded90d7517e9 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Thu, 8 Oct 2020 13:07:58 -0700 Subject: [PATCH 02/14] Use span kind in metric naming. --- .../metrics/semantic_conventions/messaging.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 560e1ab421b..962dbd7850e 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -42,10 +42,10 @@ The following metric instruments SHOULD be captured for every message send opera | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.sent.messages` | Counter | messages | Sum of messages sent. | -| `messaging.sent.duration` | ValueRecorder | milliseconds | Time spent sending a message. | -| `messaging.sent.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | -| `messaging.sent.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | +| `messaging.producer.messages` | Counter | messages | Sum of messages sent. | +| `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent sending a message. | +| `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | ## Receive Message Metric Instruments @@ -53,10 +53,10 @@ The following metric instruments SHOULD be captured for every message receive op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.received.messages` | Counter | messages | Sum of messages received. | -| `messaging.received.duration` | ValueRecorder | milliseconds | Time spent receiving a message or batch if batching messages. | -| `messaging.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | -| `messaging.received.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | +| `messaging.consumer.messages` | Counter | messages | Sum of messages received. | +| `messaging.consumer.duration` | ValueRecorder | milliseconds | Time spent receiving a message or batch if batching messages. | +| `messaging.consumer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.consumer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | ## Process Message Metric Instruments @@ -64,5 +64,5 @@ The following metric instruments SHOULD be captured for every message process op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.processed.messages` | Counter | messages | Sum of messages processed. | -| `messaging.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | +| `messaging.consumer.processed.messages` | Counter | messages | Sum of messages processed. | +| `messaging.consumer.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | From aa439d0d41393c8387dca48ca6afb774be6af20f Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Thu, 8 Oct 2020 14:32:58 -0700 Subject: [PATCH 03/14] Attempt to use the semconv yaml format and generator. --- semantic_conventions/metrics/messaging.yaml | 55 +++++++++++++++++++ .../metrics/semantic_conventions/messaging.md | 21 ++----- 2 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 semantic_conventions/metrics/messaging.yaml diff --git a/semantic_conventions/metrics/messaging.yaml b/semantic_conventions/metrics/messaging.yaml new file mode 100644 index 00000000000..8cc2cf72d6e --- /dev/null +++ b/semantic_conventions/metrics/messaging.yaml @@ -0,0 +1,55 @@ +groups: + - id: messaging + prefix: messaging + brief: > + This document defines the lables used in + messaging systems. + attributes: + - id: system + type: string + required: always + brief: 'A string identifying the messaging system.' + examples: ['kafka', 'rabbitmq', 'activemq'] + - id: destination + type: string + required: always + brief: > + The message destination name. + examples: ['MyQueue', 'MyTopic'] + - id: destination_kind + type: + allow_custom_values: false + members: + - id: queue + value: "queue" + brief: "A message sent to a queue" + - id: topic + value: "topic" + brief: "A message broadcast to the subscribers of the topic" + required: + conditional: 'Required only if the message destination is either a `queue` or `topic`.' + brief: 'The kind of message destination' + - id: temp_destination + type: boolean + required: + conditional: 'If missing, it is assumed to be false.' + brief: 'A boolean that is true if the message destination is temporary.' + - id: protocol + type: string + brief: 'The name of the transport protocol.' + examples: ['AMQP', 'MQTT'] + - id: protocol_version + type: string + brief: 'The version of the transport protocol.' + examples: '0.9.1' + - id: url + type: string + brief: 'Connection string.' + examples: ['tibjmsnaming://localhost:7222', 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'] + constraints: + - any_of: + - 'net.peer.name' + - 'net.peer.ip' + - 'net.peer.port' + - 'net.transport' + - include: network diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 962dbd7850e..0e1bd1ce6ec 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -15,23 +15,10 @@ The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conv The following labels **SHOULD** be applied to all messaging metric instruments. -| Label | Description | Example | Required | -|---|---|---|---| -| `messaging.system` | A string identifying the messaging system. | `kafka`
`rabbitmq`
`activemq` | Yes | -| `messaging.destination` | The message destination name. | `MyQueue`
`MyTopic` | Yes | -| `messaging.destination_kind` | The kind of message destination | `queue` | Conditional [1] | -| `messaging.temp_destination` | A boolean that is true if the message destination is temporary. | true | Conditional
If missing, it is assumed to be false. | -| `messaging.protocol` | The name of the transport protocol. | `AMQP`
`MQTT` | No | -| `messaging.protocol_version` | The version of the transport protocol. | `0.9.1` | No | -| `messaging.url` | Connection string. | `tibjmsnaming://localhost:7222`
`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No [2] | -| `net.peer.name` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | kafka-pool-us-east | No [2] | -| `net.peer.port` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 9092 | No [2] | -| `net.peer.ip` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | 127.0.0.1 | No [2] | -| `net.transport` | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | IP.TCP | No [2] | - -**[1]:** Required only if the message destination is either a `queue` or `topic`. - -**[2]** For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): + + + +For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): * `messaging.url` * `net.peer.name`, `net.peer.port`, `net.peer.ip`, `net.transport` From 56cdbcb3cb6e4442680d9dc09b0873a39baea85e Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Thu, 8 Oct 2020 14:48:42 -0700 Subject: [PATCH 04/14] Add metrics for batching. --- .../metrics/semantic_conventions/messaging.md | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 0e1bd1ce6ec..988fd510d3a 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -25,7 +25,9 @@ For messaging metric labels, one of the following sets of labels is RECOMMENDED ## Send Message Metric Instruments -The following metric instruments SHOULD be captured for every message send operation. +The following metric instruments SHOULD be captured for every message send operation + unless the producer is batching. If the producer is batching some metrics may be + omitted (e.g. `messaging.producer.duration` and `messaging.producer.compressed.bytes`). | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| @@ -34,9 +36,24 @@ The following metric instruments SHOULD be captured for every message send opera | `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | +### Send Batch Metric Instruments + +When a message system uses batching the following metric instruments SHOULD +be captured for every batch send operation. + +| Name | Instrument | Units | Description | +|----------------------|---------------|--------------|-------------| +| `messaging.producer.batches` | Counter | batches | Sum of batches sent. | +| `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent sending a batch. | +| `messaging.producer.batch.size` | ValueRecorder | messages | The number of messages in each batch if this producer/client is batching messages. | +| `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | +| `messaging.producer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch sent in bytes. | + ## Receive Message Metric Instruments -The following metric instruments SHOULD be captured for every message receive operation. +The following metric instruments SHOULD be captured for every message receive operation + unless the consumer is receiving batches. If the consumer is receiving batches some metrics + may be omitted (e.g. `messaging.consumer.duration` and `messaging.consumer.compressed.bytes`). | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| @@ -45,6 +62,19 @@ The following metric instruments SHOULD be captured for every message receive op | `messaging.consumer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.consumer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | +### Receive Batch Metric Instruments + +When a message system uses batching the following metric instruments SHOULD +be captured for every batch receive operation. + +| Name | Instrument | Units | Description | +|----------------------|---------------|--------------|-------------| +| `messaging.consumer.batches` | Counter | batches | Sum of batches received. | +| `messaging.consumer.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch. | +| `messaging.consumer.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | +| `messaging.consumer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | +| `messaging.consumer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch received in bytes. | + ## Process Message Metric Instruments The following metric instruments SHOULD be captured for every message process operation. @@ -53,3 +83,5 @@ The following metric instruments SHOULD be captured for every message process op |----------------------|---------------|--------------|-------------| | `messaging.consumer.processed.messages` | Counter | messages | Sum of messages processed. | | `messaging.consumer.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | + +Test From 78e7612b2d582bdb36c00f31a69b654e787d5829 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Fri, 9 Oct 2020 14:28:55 -0700 Subject: [PATCH 05/14] Update changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0dfeb3401d..7e023613e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ release. New: +- Add semantic conventions for messaging system metrics. + ([#1077](https://github.com/open-telemetry/opentelemetry-specification/pull/1077)) - Add performance benchmark specification ([#748](https://github.com/open-telemetry/opentelemetry-specification/pull/748)) - Enforce that the Baggage API must be fully functional, even without an installed SDK. From 19f96231c27285d6fa6777bd22a64b46ff318d08 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 12 Oct 2020 13:19:23 -0700 Subject: [PATCH 06/14] Make duration metrics more clear. --- specification/metrics/semantic_conventions/messaging.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 988fd510d3a..6dc375b3131 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -32,7 +32,7 @@ The following metric instruments SHOULD be captured for every message send opera | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.producer.messages` | Counter | messages | Sum of messages sent. | -| `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent sending a message. | +| `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent producing a message to a queue/topic. | | `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -44,7 +44,7 @@ be captured for every batch send operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.producer.batches` | Counter | batches | Sum of batches sent. | -| `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent sending a batch. | +| `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent prodcing a batch of messages to a queue/topic. | | `messaging.producer.batch.size` | ValueRecorder | messages | The number of messages in each batch if this producer/client is batching messages. | | `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | | `messaging.producer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch sent in bytes. | @@ -58,7 +58,7 @@ The following metric instruments SHOULD be captured for every message receive op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.consumer.messages` | Counter | messages | Sum of messages received. | -| `messaging.consumer.duration` | ValueRecorder | milliseconds | Time spent receiving a message or batch if batching messages. | +| `messaging.consumer.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | | `messaging.consumer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.consumer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -70,7 +70,7 @@ be captured for every batch receive operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.consumer.batches` | Counter | batches | Sum of batches received. | -| `messaging.consumer.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch. | +| `messaging.consumer.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | | `messaging.consumer.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | | `messaging.consumer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | | `messaging.consumer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch received in bytes. | From b21f5a7723019d3abaddb24531123da2a25e9307 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 12 Oct 2020 19:42:21 -0700 Subject: [PATCH 07/14] Switch to use references instead of constraints for net labels. --- semantic_conventions/metrics/messaging.yaml | 25 +++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/semantic_conventions/metrics/messaging.yaml b/semantic_conventions/metrics/messaging.yaml index 8cc2cf72d6e..aa5f43b00ce 100644 --- a/semantic_conventions/metrics/messaging.yaml +++ b/semantic_conventions/metrics/messaging.yaml @@ -46,10 +46,21 @@ groups: type: string brief: 'Connection string.' examples: ['tibjmsnaming://localhost:7222', 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'] - constraints: - - any_of: - - 'net.peer.name' - - 'net.peer.ip' - - 'net.peer.port' - - 'net.transport' - - include: network + - ref: net.peer.name + note: > + This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. + required: + conditional: If available. + - ref: net.peer.ip + tag: connection-level + required: + conditional: If available. + - ref: net.peer.port + tag: connection-level + required: + conditional: If available. + - ref: net.transport + tag: connection-level + brief: 'Transport protocol used.' + required: + conditional: If available. From 3353e68a675f204bd5bbdeddbd51fa6f833d6b4f Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 12 Oct 2020 19:44:22 -0700 Subject: [PATCH 08/14] Change wording of description on Counters. --- .../metrics/semantic_conventions/messaging.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 6dc375b3131..5a3902fa970 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -31,7 +31,7 @@ The following metric instruments SHOULD be captured for every message send opera | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.producer.messages` | Counter | messages | Sum of messages sent. | +| `messaging.producer.messages` | Counter | messages | Total number of messages sent. | | `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent producing a message to a queue/topic. | | `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -43,7 +43,7 @@ be captured for every batch send operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.producer.batches` | Counter | batches | Sum of batches sent. | +| `messaging.producer.batches` | Counter | batches | Total number of batches sent. | | `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent prodcing a batch of messages to a queue/topic. | | `messaging.producer.batch.size` | ValueRecorder | messages | The number of messages in each batch if this producer/client is batching messages. | | `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | @@ -57,7 +57,7 @@ The following metric instruments SHOULD be captured for every message receive op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.messages` | Counter | messages | Sum of messages received. | +| `messaging.consumer.messages` | Counter | messages | Total number of messages received. | | `messaging.consumer.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | | `messaging.consumer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.consumer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -69,7 +69,7 @@ be captured for every batch receive operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.batches` | Counter | batches | Sum of batches received. | +| `messaging.consumer.batches` | Counter | batches | Total number of batches received. | | `messaging.consumer.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | | `messaging.consumer.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | | `messaging.consumer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | @@ -81,7 +81,7 @@ The following metric instruments SHOULD be captured for every message process op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.processed.messages` | Counter | messages | Sum of messages processed. | +| `messaging.consumer.processed.messages` | Counter | messages | Total number of messages processed. | | `messaging.consumer.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | Test From 182f261e9226cc97f57eedf2bae0700452a2fd20 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 12 Oct 2020 19:48:14 -0700 Subject: [PATCH 09/14] Add received to consumer metrics to differentiate from processing. --- .../metrics/semantic_conventions/messaging.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 5a3902fa970..2074ccf34ab 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -57,10 +57,10 @@ The following metric instruments SHOULD be captured for every message receive op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.messages` | Counter | messages | Total number of messages received. | -| `messaging.consumer.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | -| `messaging.consumer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | -| `messaging.consumer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | +| `messaging.consumer.received.messages` | Counter | messages | Total number of messages received. | +| `messaging.consumer.received.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | +| `messaging.consumer.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.consumer.received.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | ### Receive Batch Metric Instruments @@ -69,11 +69,11 @@ be captured for every batch receive operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.batches` | Counter | batches | Total number of batches received. | -| `messaging.consumer.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | -| `messaging.consumer.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | -| `messaging.consumer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | -| `messaging.consumer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch received in bytes. | +| `messaging.consumer.received.batches` | Counter | batches | Total number of batches received. | +| `messaging.consumer.received.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | +| `messaging.consumer.received.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | +| `messaging.consumer.received.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | +| `messaging.consumer.received.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch received in bytes. | ## Process Message Metric Instruments From 683200fe55d2d7a6fab46f3a82a040568ed71fda Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 12 Oct 2020 21:28:52 -0700 Subject: [PATCH 10/14] Use references for metrics-messaging labels. --- semantic_conventions/metrics/messaging.yaml | 67 +++---------------- .../metrics/semantic_conventions/messaging.md | 15 ++++- 2 files changed, 25 insertions(+), 57 deletions(-) diff --git a/semantic_conventions/metrics/messaging.yaml b/semantic_conventions/metrics/messaging.yaml index aa5f43b00ce..bb762cfb049 100644 --- a/semantic_conventions/metrics/messaging.yaml +++ b/semantic_conventions/metrics/messaging.yaml @@ -1,66 +1,21 @@ groups: - - id: messaging + - id: metrics-messaging prefix: messaging brief: > - This document defines the lables used in - messaging systems. + This document defines the attributes used in + messaging system metrics. attributes: - - id: system - type: string + - ref: messaging.system required: always - brief: 'A string identifying the messaging system.' - examples: ['kafka', 'rabbitmq', 'activemq'] - - id: destination - type: string + - ref: messaging.destination required: always - brief: > - The message destination name. - examples: ['MyQueue', 'MyTopic'] - - id: destination_kind - type: - allow_custom_values: false - members: - - id: queue - value: "queue" - brief: "A message sent to a queue" - - id: topic - value: "topic" - brief: "A message broadcast to the subscribers of the topic" - required: - conditional: 'Required only if the message destination is either a `queue` or `topic`.' - brief: 'The kind of message destination' - - id: temp_destination - type: boolean - required: - conditional: 'If missing, it is assumed to be false.' - brief: 'A boolean that is true if the message destination is temporary.' - - id: protocol - type: string - brief: 'The name of the transport protocol.' - examples: ['AMQP', 'MQTT'] - - id: protocol_version - type: string - brief: 'The version of the transport protocol.' - examples: '0.9.1' - - id: url - type: string - brief: 'Connection string.' - examples: ['tibjmsnaming://localhost:7222', 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'] + - ref: messaging.destination_kind + required: always + - ref: messaging.temp_destination + - ref: messaging.protocol + - ref: messaging.protocol_version + - ref: messaging.url - ref: net.peer.name - note: > - This should be the IP/hostname of the broker (or other network-level peer) this specific message is sent to/received from. - required: - conditional: If available. - ref: net.peer.ip - tag: connection-level - required: - conditional: If available. - ref: net.peer.port - tag: connection-level - required: - conditional: If available. - ref: net.transport - tag: connection-level - brief: 'Transport protocol used.' - required: - conditional: If available. diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 2074ccf34ab..eae1783084b 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -15,7 +15,20 @@ The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conv The following labels **SHOULD** be applied to all messaging metric instruments. - + +| Attribute | Type | Description | Example | Required | +|---|---|---|---|---| +| `messaging.destination` | string | The message destination name. This might be equal to the span name but is required nevertheless. | `MyQueue`
`MyTopic` | Yes | +| `messaging.destination_kind` | string enum | The kind of message destination | `queue` | Yes | +| `messaging.protocol` | string | The name of the transport protocol. | `AMQP`
`MQTT` | No | +| `messaging.protocol_version` | string | The version of the transport protocol. | `0.9.1` | No | +| `messaging.system` | string | A string identifying the messaging system. | `kafka`
`rabbitmq`
`activemq` | Yes | +| `messaging.temp_destination` | boolean | A boolean that is true if the message destination is temporary. | | No | +| `messaging.url` | string | Connection string. | `tibjmsnaming://localhost:7222`
`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No | +| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No | +| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | No | +| `net.peer.port` | number | Remote port number. | `80`
`8080`
`443` | No | +| `net.transport` | string enum | Transport protocol used. See note below. | `IP.TCP` | No | For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): From 6041dc6f74f18a288b802ca6e1befaadb9d055d0 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Thu, 15 Oct 2020 14:18:47 -0700 Subject: [PATCH 11/14] Remove redundant counters. --- specification/metrics/semantic_conventions/messaging.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index eae1783084b..aea10fd6890 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -44,7 +44,6 @@ The following metric instruments SHOULD be captured for every message send opera | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.producer.messages` | Counter | messages | Total number of messages sent. | | `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent producing a message to a queue/topic. | | `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -56,7 +55,6 @@ be captured for every batch send operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.producer.batches` | Counter | batches | Total number of batches sent. | | `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent prodcing a batch of messages to a queue/topic. | | `messaging.producer.batch.size` | ValueRecorder | messages | The number of messages in each batch if this producer/client is batching messages. | | `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | @@ -70,7 +68,6 @@ The following metric instruments SHOULD be captured for every message receive op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.received.messages` | Counter | messages | Total number of messages received. | | `messaging.consumer.received.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | | `messaging.consumer.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.consumer.received.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | @@ -82,7 +79,6 @@ be captured for every batch receive operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.received.batches` | Counter | batches | Total number of batches received. | | `messaging.consumer.received.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | | `messaging.consumer.received.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | | `messaging.consumer.received.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | @@ -94,7 +90,6 @@ The following metric instruments SHOULD be captured for every message process op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.consumer.processed.messages` | Counter | messages | Total number of messages processed. | | `messaging.consumer.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | Test From c573be5fb13b4a8e7824382d055b04ec174aee12 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 19 Oct 2020 15:16:08 -0700 Subject: [PATCH 12/14] Fix lint errors. --- specification/metrics/semantic_conventions/messaging.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index aea10fd6890..a0029345ce1 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -1,12 +1,12 @@ # Semantic conventions for messaging system metrics The conventions described in this section are specific to messaging systems. When interactions with messaging systems occur, -metric events about those operations will be generated and reported, providing insight into those +metric events about those operations will be generated and reported, providing insight into those operations. **Disclaimer:** These are initial messaging system metric instruments and labels, more may be added in the future. - + ## Definitions The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conventions/messaging.md#definitions) is a resource for the messaging system terminology used in this document. @@ -91,5 +91,3 @@ The following metric instruments SHOULD be captured for every message process op | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.consumer.processed.duration` | ValueRecorder | milliseconds | Time spent processing a message. | - -Test From dc5c766ea5311112e71c070684b95fd71357a6ca Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Mon, 19 Oct 2020 15:22:15 -0700 Subject: [PATCH 13/14] Fix table formatting. --- .../metrics/semantic_conventions/messaging.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index a0029345ce1..2de95592488 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -18,17 +18,17 @@ The following labels **SHOULD** be applied to all messaging metric instruments. | Attribute | Type | Description | Example | Required | |---|---|---|---|---| -| `messaging.destination` | string | The message destination name. This might be equal to the span name but is required nevertheless. | `MyQueue`
`MyTopic` | Yes | -| `messaging.destination_kind` | string enum | The kind of message destination | `queue` | Yes | -| `messaging.protocol` | string | The name of the transport protocol. | `AMQP`
`MQTT` | No | -| `messaging.protocol_version` | string | The version of the transport protocol. | `0.9.1` | No | -| `messaging.system` | string | A string identifying the messaging system. | `kafka`
`rabbitmq`
`activemq` | Yes | -| `messaging.temp_destination` | boolean | A boolean that is true if the message destination is temporary. | | No | -| `messaging.url` | string | Connection string. | `tibjmsnaming://localhost:7222`
`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No | -| `net.peer.ip` | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No | -| `net.peer.name` | string | Remote hostname or similar, see note below. | `example.com` | No | -| `net.peer.port` | number | Remote port number. | `80`
`8080`
`443` | No | -| `net.transport` | string enum | Transport protocol used. See note below. | `IP.TCP` | No | +| [`messaging.destination`](../../trace/semantic_conventions/messaging.md) | string | The message destination name. This might be equal to the span name but is required nevertheless. | `MyQueue`
`MyTopic` | Yes | +| [`messaging.destination_kind`](../../trace/semantic_conventions/messaging.md) | string enum | The kind of message destination | `queue` | Yes | +| [`messaging.protocol`](../../trace/semantic_conventions/messaging.md) | string | The name of the transport protocol. | `AMQP`
`MQTT` | No | +| [`messaging.protocol_version`](../../trace/semantic_conventions/messaging.md) | string | The version of the transport protocol. | `0.9.1` | No | +| [`messaging.system`](../../trace/semantic_conventions/messaging.md) | string | A string identifying the messaging system. | `kafka`
`rabbitmq`
`activemq` | Yes | +| [`messaging.temp_destination`](../../trace/semantic_conventions/messaging.md) | boolean | A boolean that is true if the message destination is temporary. | | No | +| [`messaging.url`](../../trace/semantic_conventions/messaging.md) | string | Connection string. | `tibjmsnaming://localhost:7222`
`https://queue.amazonaws.com/80398EXAMPLE/MyQueue` | No | +| [`net.peer.ip`](../../trace/semantic_conventions/span-general.md) | string | Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6) | `127.0.0.1` | No | +| [`net.peer.name`](../../trace/semantic_conventions/span-general.md) | string | Remote hostname or similar, see note below. | `example.com` | No | +| [`net.peer.port`](../../trace/semantic_conventions/span-general.md) | number | Remote port number. | `80`
`8080`
`443` | No | +| [`net.transport`](../../trace/semantic_conventions/span-general.md) | string enum | Transport protocol used. See note below. | `IP.TCP` | No | For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): From 8683a2a2dee8b9df2be546d5e3539aaa98936213 Mon Sep 17 00:00:00 2001 From: Chris Wildman Date: Fri, 6 Nov 2020 10:32:31 -0800 Subject: [PATCH 14/14] PR feedback. --- semantic_conventions/metrics/messaging.yaml | 2 +- .../metrics/semantic_conventions/messaging.md | 33 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/semantic_conventions/metrics/messaging.yaml b/semantic_conventions/metrics/messaging.yaml index bb762cfb049..973196dee3d 100644 --- a/semantic_conventions/metrics/messaging.yaml +++ b/semantic_conventions/metrics/messaging.yaml @@ -3,7 +3,7 @@ groups: prefix: messaging brief: > This document defines the attributes used in - messaging system metrics. + messaging system metric instruments. attributes: - ref: messaging.system required: always diff --git a/specification/metrics/semantic_conventions/messaging.md b/specification/metrics/semantic_conventions/messaging.md index 2de95592488..32100b857bd 100644 --- a/specification/metrics/semantic_conventions/messaging.md +++ b/specification/metrics/semantic_conventions/messaging.md @@ -1,4 +1,4 @@ -# Semantic conventions for messaging system metrics +# Semantic conventions for messaging systems The conventions described in this section are specific to messaging systems. When interactions with messaging systems occur, metric events about those operations will be generated and reported, providing insight into those @@ -13,7 +13,7 @@ The [Trace Messaging Semantic Conventions Definitions](../../trace/semantic_conv ## Common Labels -The following labels **SHOULD** be applied to all messaging metric instruments. +The following labels SHOULD be applied to all messaging metric instruments. | Attribute | Type | Description | Example | Required | @@ -31,62 +31,61 @@ The following labels **SHOULD** be applied to all messaging metric instruments. | [`net.transport`](../../trace/semantic_conventions/span-general.md) | string enum | Transport protocol used. See note below. | `IP.TCP` | No | -For messaging metric labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): +For messaging system metric event labels, one of the following sets of labels is RECOMMENDED (in order of usual preference unless for a particular messaging system it is known that some other set is preferable for some reason; all strings must be non-empty): * `messaging.url` * `net.peer.name`, `net.peer.port`, `net.peer.ip`, `net.transport` ## Send Message Metric Instruments -The following metric instruments SHOULD be captured for every message send operation - unless the producer is batching. If the producer is batching some metrics may be - omitted (e.g. `messaging.producer.duration` and `messaging.producer.compressed.bytes`). +The following metric instruments SHOULD be used to capture metric events for every message send operation + unless the producer is batching. If the producer is batching any metric instruments +within this section MAY be omitted. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.producer.duration` | ValueRecorder | milliseconds | Time spent producing a message to a queue/topic. | -| `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.producer.bytes` | ValueRecorder | bytes | The (uncompressed) size of the payload sent in bytes. Also use this metric instrument if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.producer.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | ### Send Batch Metric Instruments When a message system uses batching the following metric instruments SHOULD -be captured for every batch send operation. +be used to capture metric events for every batch send operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| -| `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent prodcing a batch of messages to a queue/topic. | +| `messaging.producer.batch.duration` | ValueRecorder | milliseconds | Time spent producing a batch of messages to a queue/topic. | | `messaging.producer.batch.size` | ValueRecorder | messages | The number of messages in each batch if this producer/client is batching messages. | -| `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | +| `messaging.producer.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch sent in bytes. Also use this metric instrument if it is unknown whether the compressed or uncompressed batch size is reported. | | `messaging.producer.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch sent in bytes. | ## Receive Message Metric Instruments -The following metric instruments SHOULD be captured for every message receive operation - unless the consumer is receiving batches. If the consumer is receiving batches some metrics - may be omitted (e.g. `messaging.consumer.duration` and `messaging.consumer.compressed.bytes`). +The following metric instruments SHOULD be used to capture metric events for every message receive operation + unless the consumer is receiving batches. If the consumer is receiving batches any metric instruments within this section MAY be omitted. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.consumer.received.duration` | ValueRecorder | milliseconds | Time spent receiving a message from a queue/topic. | -| `messaging.consumer.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed payload size is reported. | +| `messaging.consumer.received.bytes` | ValueRecorder | bytes | The (uncompressed) size of the message received in bytes. Also use this metric instrument if it is unknown whether the compressed or uncompressed payload size is reported. | | `messaging.consumer.received.compressed.bytes` | ValueRecorder | bytes | The compressed size of the payload sent in bytes. | ### Receive Batch Metric Instruments When a message system uses batching the following metric instruments SHOULD -be captured for every batch receive operation. +be used to capture metric events for every batch receive operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------| | `messaging.consumer.received.batch.duration` | ValueRecorder | milliseconds | Time spent receiving a batch of messages from a queue/topic. | | `messaging.consumer.received.batch.size` | ValueRecorder | messages | The number of messages in each batch if messages are consumed in batches. | -| `messaging.consumer.received.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric if it is unknown whether the compressed or uncompressed batch size is reported. | +| `messaging.consumer.received.batch.bytes` | ValueRecorder | bytes | The (uncompressed) size of the batch received in bytes. Also use this metric instrument if it is unknown whether the compressed or uncompressed batch size is reported. | | `messaging.consumer.received.batch.compressed.bytes` | ValueRecorder | bytes | The compressed size of the batch received in bytes. | ## Process Message Metric Instruments -The following metric instruments SHOULD be captured for every message process operation. +The following metric instruments SHOULD be used to capture metric events for every message processing operation. | Name | Instrument | Units | Description | |----------------------|---------------|--------------|-------------|