Skip to content

Commit 3a624a5

Browse files
kafka: Add broker start time metric tagged with broker_id (DataDog#23020)
* kafka: Add broker start time metric tagged with broker_id Add a new metric kafka.broker.start_time that extracts the broker ID from the kafka.server:type=app-info,id=<broker_id> JMX bean name and applies it as a broker_id tag. This is the first Kafka metric to carry the broker_id tag, enabling per-broker metric correlation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix CI: add changelog and assert new broker start_time metric in test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3ea599f commit 3a624a5

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

kafka/changelog.d/23020.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add kafka.broker.start_time metric tagged with broker_id.

kafka/datadog_checks/kafka/data/metrics.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,3 +898,20 @@ jmx_metrics:
898898
- tag_name: kafka_cluster_id
899899
bean_name: kafka.server:type=KafkaServer,name=ClusterId
900900
attribute: Value
901+
902+
#
903+
# Broker info
904+
#
905+
- include:
906+
domain: 'kafka.server'
907+
bean_regex: 'kafka\.server:type=app-info,id=(.*)'
908+
attribute:
909+
StartTimeMs:
910+
metric_type: gauge
911+
alias: kafka.broker.start_time
912+
tags:
913+
broker_id: $1
914+
dynamic_tags:
915+
- tag_name: kafka_cluster_id
916+
bean_name: kafka.server:type=KafkaServer,name=ClusterId
917+
attribute: Value

kafka/metadata.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name,curated_metric
2+
kafka.broker.start_time,gauge,10,millisecond,,The start time of the Kafka broker in milliseconds since epoch.,0,kafka,broker start time,
23
kafka.consumer.bytes_consumed,gauge,10,byte,second,The average number of bytes consumed per second for a specific topic.,1,kafka,con bytes consumed,
34
kafka.consumer.bytes_in,gauge,10,byte,second,Consumer bytes in rate.,1,kafka,con bytes in,
45
kafka.consumer.delayed_requests,gauge,10,request,,Number of delayed consumer requests.,-1,kafka,con delayed req,

kafka/tests/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@
6969
"kafka.session.fetch.eviction",
7070
# Listeners
7171
"kafka.server.socket.connection_count",
72+
# Broker
73+
"kafka.broker.start_time",
7274
]

0 commit comments

Comments
 (0)