Skip to content

Commit

Permalink
Add remaining Kafka and Kafka consumer metrics. (#2536)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalberto authored May 26, 2022
1 parent db6afbc commit 58acb09
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ release.
([#2502](https://github.com/open-telemetry/opentelemetry-specification/pull/2502))
- Define attribute requirement levels
([#2522](https://github.com/open-telemetry/opentelemetry-specification/pull/2522))
- Add semantic conventions for Kafka consumer metrics
([#2536](https://github.com/open-telemetry/opentelemetry-specification/pull/2536))

### Compatibility

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This document defines how to apply semantic conventions when instrumenting Kafka

- [Kafka Metrics](#kafka-metrics)
- [Kafka Producer Metrics](#kafka-producer-metrics)
- [Kafka Consumer Metrics](#kafka-consumer-metrics)

<!-- tocstop -->

Expand All @@ -30,6 +31,16 @@ This document defines how to apply semantic conventions when instrumenting Kafka
| messaging.kafka.controllers.active | UpDownCounter | Int64 | controllers | `{controllers}` | The number of active controllers in the broker. | | |
| messaging.kafka.leader.elections | Counter | Int64 | elections | `{elections}` | Leader election rate (increasing values indicates broker failures). | | |
| messaging.kafka.leader.unclean-elections | Counter | Int64 | elections | `{elections}` | Unclean leader election rate (increasing values indicates broker failures). | | |
| messaging.kafka.brokers | UpDownCounter | Int64 | brokers | `{brokers}` | Number of brokers in the cluster. | | |
| messaging.kafka.topic.partitions | UpDownCounter | Int64 | partitions | `{partitions}` | Number of partitions in topic. | `topic` | The ID (integer) of a topic |
| messaging.kafka.partition.current_offset | Gauge | Int64 | partition offset | `{partition offset}` | Current offset of partition of topic. | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition |
| messaging.kafka.partition.oldest_offset | Gauge | Int64 | partition offset | `{partition offset}` | Oldest offset of partition of topic | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition |
| messaging.kafka.partition.replicas.all | UpDownCounter | Int64 | replicas | `{replicas}` | Number of replicas for partition of topic | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition |
| messaging.kafka.partition.replicas.in_sync | UpDownCounter | Int64 | replicas | `{replicas}` | Number of synchronized replicas of partition | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition|

## Kafka Producer Metrics

Expand All @@ -49,3 +60,21 @@ This document defines how to apply semantic conventions when instrumenting Kafka
| | | | | | | `topic` | topic name |
| messaging.kafka.producer.record-sent.rate | Gauge | Double | records sent rate | `{records_sent}/s` | The average number of records sent per second for a specific topic. | `client-id` | `client-id` value |
| | | | | | | `topic` | topic name |

## Kafka Consumer Metrics

**Description:** Kafka Consumer level metrics.

| Name | Instrument | Value type | Unit | Unit ([UCUM](../README.md#instrument-units)) | Description | Attribute Key | Attribute Values |
| --------------------------------------------- | ------------- | ---------- | ------ | -------------------------------------------- | -------------- | ------------- | ---------------- |
| messaging.kafka.consumer.members | UpDownCounter | Int64 | members | `{members}` | Count of members in the consumer group | `group` | The ID (string) of a consumer group |
| messaging.kafka.consumer.offset | Gauge | Int64 | offset | `{offset}` | Current offset of the consumer group at partition of topic | `group` | The ID (string) of a consumer group |
| | | | | | | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition |
| messaging.kafka.consumer.offset_sum | Gauge | Int64 | offset sum | `{offset sum}` | Sum of consumer group offset across partitions of topic | `group` | The ID (string) of a consumer group |
| | | | | | | `topic` | The ID (integer) of a topic |
| messaging.kafka.consumer.lag | Gauge | Int64 | lag | `{lag}` | Current approximate lag of consumer group at partition of topic | `group` | The ID (string) of a consumer group |
| | | | | | | `topic` | The ID (integer) of a topic |
| | | | | | | `partition` | The number (integer) of the partition |
| messaging.kafka.consumer.lag_sum | Gauge | Int64 | lag sum | `{lag sum}` | Current approximate sum of consumer group lag across all partitions of topic | `group` | The ID (string) of a consumer group |
| | | | | | | `topic` | The ID (integer) of a topic |

0 comments on commit 58acb09

Please sign in to comment.