Skip to content
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

Fixed regex the metrics of kafka client #443

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions example_configs/kafka-2_0_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ rules:
type: COUNTER
labels:
"$4": "$5"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.+)><>Mean
name: kafka_$1_$2_$3
type: GAUGE
labels:
"$4": "$5"
quantile: "avg"
- pattern: kafka.(\w+)<type=(.+), name=(.+), (.+)=(.*)><>(\d+)thPercentile
name: kafka_$1_$2_$3
type: GAUGE
Expand Down
98 changes: 98 additions & 0 deletions example_configs/kafka-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
lowercaseOutputName: true
lowercaseOutputLabelNames: true
rules:
### Metrics with Attributes
#kafka.admin.client:type=admin-client-metrics,client-id=moody-test_client-admin
#kafka.consumer:type=consumer-coordinator-metrics,client-id=moody-test_client-StreamThread-1-consumer
#kafka.consumer:type=consumer-fetch-manager-metrics,client-id=moody-test_client-StreamThread-1-consumer
#kafka.consumer:type=consumer-metrics,client-id=moody-test_client-StreamThread-1-consumer
#kafka.producer:type=producer-metrics,client-id=moody-test_client-StreamThread-1-producer
#kafka.streams:type=stream-metrics,client-id=moody-test_client-StreamThread-1
#kafka.consumer:type=consumer-fetch-manager-metrics,client-id=moody-test_client-StreamThread-1-consumer,topic=realtime-clustered-documents,partition=92
#kafka.admin.client:type=admin-client-node-metrics,client-id=moody-test_client-admin,node-id=node--1
#kafka.consumer:type=consumer-node-metrics,client-id=moody-test_client-StreamThread-2-consumer,node-id=node--1
#kafka.producer:type=producer-node-metrics,client-id=moody-test_client-StreamThread-1-producer,node-id=node--1
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), topic=(.+), partition=(.+)><>([a-z-]+)
name: kafka_$1_$2_$6
labels:
clientId: "$3"
topic: "$4"
partition: "$5"
help: "Kafka client JMX metric $1 $2"
type: GAUGE
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), topic=(.+)><>([a-z-]+)
name: kafka_$1_$2_$5
labels:
clientId: "$3"
topic: "$4"
help: "Kafka client JMX metric $1 $2"
type: GAUGE
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), node-id=(.+)><>([a-z-]+)
name: kafka_$1_$2_$5
labels:
clientId: "$3"
nodeId: "$4"
help: "Kafka client JMX metric $1 $2"
type: GAUGE
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+)><>([a-z-]+)
name: kafka_$1_$2_$4
labels:
clientId: "$3"
help: "Kafka client JMX metric $1 $2"
type: GAUGE

#kafka.streams:type=stream-processor-node-metrics,client-id=moody-test_client-StreamThread-1,task-id=0_100,processor-node-id=KSTREAM-PROCESSOR-0000000001
#kafka.streams:type=stream-task-metrics,client-id=moody-test_client-StreamThread-1,task-id=0_92
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), task-id=(.+), processor-node-id=(.+)><>([a-z-]+)"
name: kafka_$1_$2_6
labels:
clientId: "$3"
taskId: "$4"
processorNodeId: "$5"
help: "Kafka client JMX metric $1 $2"
type: GAUGE
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), task-id=(.+)><>([a-z-]+)
name: kafka_$1_$2_$5
labels:
clientId: "$3"
taskId: "$4"
help: "Kafka client JMX metric $1 $2"
type: GAUGE

### Metrics with Labels
#kafka.admin.client:type=app-info,client-id=moody-test_client-admin
#kafka.consumer:type=app-info,client-id=moody-test_client-StreamThread-1-consumer
#kafka.producer:type=app-info,client-id=moody-test_client-StreamThread-1-producer
- pattern: kafka.(.+)<type=(app-info), client-id=(.+)><>commit-id:(.+)
name: kafka_$1_$2
value: 1
labels:
clientId: "$3"
commitId: "$4"
help: "Kafka client JMX metric $1 $2"
- pattern: kafka.(.+)<type=(app-info), client-id=(.+)><>version:(.+)
name: kafka_$1_$2
value: 1
labels:
clientId: "$3"
version: "$4"
help: "Kafka client JMX metric $1 $2"

### Metrics with count values
#kafka.admin.client:type=kafka-metrics-count,client-id=moody-test_client-admin
#kafka.consumer:type=kafka-metrics-count,client-id=moody-test_client-StreamThread-1-consumer
#kafka.producer:type=kafka-metrics-count,client-id=moody-test_client-StreamThread-1-producer
- pattern: kafka.(.+)<type=(.+)-metrics-count, client-id=(.+)><>([a-z-]+)
name: kafka_$1_$2_$4
labels:
clientId: "$3"
help: "Kafka client JMX metric $1 $2"
type: COUNTER

#kafka.streams:type=kafka-metrics-count
- pattern: kafka.(.*)<type=(.+)-metrics-count, client-id=(.+)><>([a-z-]+)
name: kafka_$1_$2_$4
labels:
clientId: "$3"
help: "Kafka client JMX metric $1 $2"
type: COUNTER