-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
226 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
groups: | ||
- id: metric.messaging.attributes | ||
type: attribute_group | ||
brief: "Common messaging metrics attributes." | ||
extends: messaging.attributes.common | ||
attributes: | ||
- ref: messaging.destination.name | ||
requirement_level: | ||
conditionally_required: if and only if `messaging.destination.name` is known to have low cardinality. Otherwise, `messaging.destination.template` MAY be populated. | ||
- ref: messaging.destination.template | ||
requirement_level: | ||
conditionally_required: if available. | ||
- id: messaging.todo.status | ||
type: string | ||
brief: "The status of the operation: TODO" | ||
requirement_level: required | ||
examples: ["ok", "error", "timeout"] | ||
|
||
- id: metric.messaging.publish.duration | ||
type: metric | ||
metric_name: messaging.publish.duration | ||
brief: "Measures the duration of publish operation." | ||
instrument: histogram | ||
unit: "s" | ||
extends: metric.messaging.attributes | ||
|
||
- id: metric.messaging.receive.duration | ||
type: metric | ||
metric_name: messaging.receive.duration | ||
brief: "Measures the duration of receive operation." | ||
instrument: histogram | ||
unit: "s" | ||
extends: metric.messaging.attributes | ||
|
||
- id: metric.messaging.delivery.duration | ||
type: metric | ||
metric_name: messaging.delivery.duration | ||
brief: "Measures the duration of receive operation." | ||
instrument: histogram | ||
unit: "s" | ||
extends: metric.messaging.attributes | ||
|
||
- id: metric.messaging.settle.duration | ||
type: metric | ||
metric_name: messaging.settle.duration | ||
brief: "Measures the duration of settle operation." | ||
instrument: histogram | ||
unit: "s" | ||
extends: metric.messaging.attributes | ||
attributes: | ||
- id: messaging.todo_settlement.status | ||
type: string | ||
brief: "The status of the settlement: acknowledged, rejected, TODO" | ||
examples: ["ack", "nack"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
specification/metrics/semantic_conventions/messaging-metrics.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<!--- Hugo front matter used to generate the website version of this page: | ||
linkTitle: HTTP | ||
---> | ||
|
||
# Semantic Conventions for Messaging Metrics | ||
|
||
**Status**: [Experimental][DocumentStatus] | ||
|
||
The conventions described in this section are messaging specific. | ||
|
||
**Disclaimer:** These are initial messaging metric instruments and attributes but more may be added in the future. | ||
|
||
<!-- toc --> | ||
<!-- tocstop --> | ||
|
||
## Metric: `messaging.publish.duration` | ||
|
||
This metric is required. | ||
|
||
When this metric is reported alongside an messaging publish span, the metric value SHOULD be the same as the corresponding span duration. | ||
|
||
This metric SHOULD be specified with | ||
[`ExplicitBucketBoundaries`](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.21.0/specification/metrics/api.md#instrument-advice) | ||
of `[ 0, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`. | ||
|
||
<!-- semconv metric.messaging.publish.duration(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `messaging.publish.duration` | Histogram | `s` | Measures the duration of publish operation. | | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.messaging.publish.duration(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `messaging.system` | string | A string identifying the messaging system. | `kafka`; `rabbitmq`; `rocketmq`; `activemq`; `AmazonSQS` | Required | | ||
| `messaging.todo.status` | string | The status of the operation: TODO | `ok`; `error`; `timeout` | Required | | ||
| `messaging.destination.name` | string | The message destination name [1] | `MyQueue`; `MyTopic` | Conditionally Required: [2] | | ||
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [3] | `/customers/{customerId}` | Conditionally Required: if available. | | ||
| [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `mqtt` | Recommended | | ||
| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | ||
| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. | `example.com` | Conditionally Required: If available. | | ||
| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Logical server port number | `80`; `8080`; `443` | Conditionally Required: If available. | | ||
| [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | | ||
|
||
**[1]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If | ||
the broker does not have such notion, the destination name SHOULD uniquely identify the broker. | ||
|
||
**[2]:** if and only if `messaging.destination.name` is known to have low cardinality. Otherwise, `messaging.destination.template` MAY be populated. | ||
|
||
**[3]:** 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. | ||
|
||
**[4]:** `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 used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. | ||
<!-- endsemconv --> | ||
|
||
## Metric: `messaging.receive.duration` | ||
|
||
This metric is recommended when messaging system supports poll-based receive operations. | ||
|
||
<!-- semconv metric.messaging.receive.duration(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `messaging.receive.duration` | Histogram | `s` | Measures the duration of receive operation. | | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.messaging.publish.duration(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `messaging.system` | string | A string identifying the messaging system. | `kafka`; `rabbitmq`; `rocketmq`; `activemq`; `AmazonSQS` | Required | | ||
| `messaging.todo.status` | string | The status of the operation: TODO | `ok`; `error`; `timeout` | Required | | ||
| `messaging.destination.name` | string | The message destination name [1] | `MyQueue`; `MyTopic` | Conditionally Required: [2] | | ||
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [3] | `/customers/{customerId}` | Conditionally Required: if available. | | ||
| [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `mqtt` | Recommended | | ||
| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | ||
| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. | `example.com` | Conditionally Required: If available. | | ||
| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Logical server port number | `80`; `8080`; `443` | Conditionally Required: If available. | | ||
| [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | | ||
|
||
**[1]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If | ||
the broker does not have such notion, the destination name SHOULD uniquely identify the broker. | ||
|
||
**[2]:** if and only if `messaging.destination.name` is known to have low cardinality. Otherwise, `messaging.destination.template` MAY be populated. | ||
|
||
**[3]:** 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. | ||
|
||
**[4]:** `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 used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. | ||
<!-- endsemconv --> | ||
|
||
|
||
## Metric: `messaging.settle.duration` | ||
|
||
This metric is recommended when messaging system supports settle operations. | ||
|
||
<!-- semconv metric.messaging.settle.duration(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `messaging.settle.duration` | Histogram | `s` | Measures the duration of settle operation. | | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.messaging.settle.duration(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| `messaging.system` | string | A string identifying the messaging system. | `kafka`; `rabbitmq`; `rocketmq`; `activemq`; `AmazonSQS` | Required | | ||
| `messaging.todo.status` | string | The status of the operation: TODO | `ok`; `error`; `timeout` | Required | | ||
| `messaging.todo_settlement.status` | string | The status of the settlement: acknowledged, rejected, TODO | `ack`; `nack` | Recommended | | ||
| `messaging.destination.name` | string | The message destination name [1] | `MyQueue`; `MyTopic` | Conditionally Required: [2] | | ||
| `messaging.destination.template` | string | Low cardinality representation of the messaging destination name [3] | `/customers/{customerId}` | Conditionally Required: if available. | | ||
| [`network.protocol.name`](../../trace/semantic_conventions/span-general.md) | string | [OSI Application Layer](https://osi-model.com/application-layer/) or non-OSI equivalent. The value SHOULD be normalized to lowercase. | `amqp`; `mqtt` | Recommended | | ||
| [`network.protocol.version`](../../trace/semantic_conventions/span-general.md) | string | Version of the application layer protocol used. See note below. [4] | `3.1.1` | Recommended | | ||
| [`server.address`](../../trace/semantic_conventions/span-general.md) | string | Logical server hostname, matches server FQDN if available, and IP or socket address if FQDN is not known. | `example.com` | Conditionally Required: If available. | | ||
| [`server.port`](../../trace/semantic_conventions/span-general.md) | int | Logical server port number | `80`; `8080`; `443` | Conditionally Required: If available. | | ||
| [`server.socket.address`](../../trace/semantic_conventions/span-general.md) | string | Physical server IP address or Unix socket address. | `10.5.3.2` | Recommended: If different than `server.address`. | | ||
|
||
**[1]:** Destination name SHOULD uniquely identify a specific queue, topic or other entity within the broker. If | ||
the broker does not have such notion, the destination name SHOULD uniquely identify the broker. | ||
|
||
**[2]:** if and only if `messaging.destination.name` is known to have low cardinality. Otherwise, `messaging.destination.template` MAY be populated. | ||
|
||
**[3]:** 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. | ||
|
||
**[4]:** `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 used has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. | ||
<!-- endsemconv --> | ||
|
||
## Others: | ||
|
||
- batch size (payload, in bytes): probably transport-level concept, not necessary here | ||
- consumer lag/queue size - need to define new attributes (enqueue/creation time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters