-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messaging metric overrides #687
Changes from all commits
48881da
331e2d0
819573f
34f2d2e
6b70542
bacd414
2df3f17
5e35de8
26e1f4b
caf936e
70776b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
change_type: enhancement | ||
|
||
component: messaging | ||
|
||
note: Extends generic messaging metrics for RabbitMQ, Kafka, and Azure messaging services | ||
|
||
issues: [553] |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,12 @@ linkTitle: Kafka | |
|
||
<!-- toc --> | ||
|
||
- [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) | ||
|
||
|
@@ -20,7 +25,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,6 +49,62 @@ 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. | ||
|
||
## 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:** | ||
|
||
- 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` | ||
|
||
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:** | ||
|
||
- 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` | ||
|
||
Measures duration of consumer 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:** | ||
|
||
- 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` | ||
|
||
### 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:** | ||
|
||
- 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` | ||
Comment on lines
+104
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need to clarify with the wider semantic conventions community whether this is the way we want to extend generic metric definitions. The approach proposed in this PR is endorsed by the messaging workgroup, because it allows telemetry consumers to utilize a single metric (for example For obtaining system-specific information, it is still possible to utilize the additional system-specific attributes on the metric. |
||
|
||
## Examples | ||
|
||
### Apache Kafka with Quarkus or Spring Boot Example | ||
|
@@ -85,3 +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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, didn't we had a person working on the Kakfa metrics and decided to not have them in semconv? How these will fit with those? Or are those broker and these are client ones?