-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added monitoring metrics to the kafka-connect chart (#8)
* Added monitoring metrics to the kafka-connect chart * bumped kafka-connect chart version * Disable kafka-connect monitoring by default to pass pipeline checks
- Loading branch information
Showing
5 changed files
with
250 additions
and
1 deletion.
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
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
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,185 @@ | ||
{{- if .Values.monitoring.enabled }} | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ printf "%s-metrics" (include "kafka-connect.name" .) }} | ||
labels: | ||
app: strimzi | ||
data: | ||
metrics-config.yml: | | ||
# Inspired by kafka-connect rules | ||
# https://github.com/prometheus/jmx_exporter/blob/master/example_configs/kafka-connect.yml | ||
# See https://github.com/prometheus/jmx_exporter for more info about JMX Prometheus Exporter metrics | ||
lowercaseOutputName: true | ||
lowercaseOutputLabelNames: true | ||
rules: | ||
#kafka.connect:type=app-info,client-id="{clientid}" | ||
#kafka.consumer:type=app-info,client-id="{clientid}" | ||
#kafka.producer:type=app-info,client-id="{clientid}" | ||
- pattern: 'kafka.(.+)<type=app-info, client-id=(.+)><>start-time-ms' | ||
name: kafka_$1_start_time_seconds | ||
labels: | ||
clientId: "$2" | ||
help: "Kafka $1 JMX metric start time seconds" | ||
type: GAUGE | ||
valueFactor: 0.001 | ||
- pattern: 'kafka.(.+)<type=app-info, client-id=(.+)><>(commit-id|version): (.+)' | ||
name: kafka_$1_$3_info | ||
value: 1 | ||
labels: | ||
clientId: "$2" | ||
$3: "$4" | ||
help: "Kafka $1 JMX metric info version and commit-id" | ||
type: UNTYPED | ||
#kafka.consumer:type=consumer-fetch-manager-metrics,client-id="{clientid}",topic="{topic}"", partition="{partition}" | ||
- pattern: kafka.consumer<type=consumer-fetch-manager-metrics, client-id=(.+), topic=(.+), partition=(.+)><>(.+-total) | ||
name: kafka_consumer_fetch_manager_$4 | ||
labels: | ||
clientId: "$1" | ||
topic: "$2" | ||
partition: "$3" | ||
help: "Kafka Consumer JMX metric type consumer-fetch-manager-metrics" | ||
type: COUNTER | ||
- pattern: kafka.consumer<type=consumer-fetch-manager-metrics, client-id=(.+), topic=(.+), partition=(.+)><>(compression-rate|.+-avg|.+-replica|.+-lag|.+-lead) | ||
name: kafka_consumer_fetch_manager_$4 | ||
labels: | ||
clientId: "$1" | ||
topic: "$2" | ||
partition: "$3" | ||
help: "Kafka Consumer JMX metric type consumer-fetch-manager-metrics" | ||
type: GAUGE | ||
#kafka.producer:type=producer-topic-metrics,client-id="{clientid}",topic="{topic}" | ||
- pattern: kafka.producer<type=producer-topic-metrics, client-id=(.+), topic=(.+)><>(.+-total) | ||
name: kafka_producer_topic_$3 | ||
labels: | ||
clientId: "$1" | ||
topic: "$2" | ||
help: "Kafka Producer JMX metric type producer-topic-metrics" | ||
type: COUNTER | ||
- pattern: kafka.producer<type=producer-topic-metrics, client-id=(.+), topic=(.+)><>(compression-rate|.+-avg|.+rate) | ||
name: kafka_producer_topic_$3 | ||
labels: | ||
clientId: "$1" | ||
topic: "$2" | ||
help: "Kafka Producer JMX metric type producer-topic-metrics" | ||
type: GAUGE | ||
#kafka.connect:type=connect-node-metrics,client-id="{clientid}",node-id="{nodeid}" | ||
#kafka.consumer:type=consumer-node-metrics,client-id=consumer-1,node-id="{nodeid}" | ||
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), node-id=(.+)><>(.+-total) | ||
name: kafka_$2_$5 | ||
labels: | ||
clientId: "$3" | ||
nodeId: "$4" | ||
help: "Kafka $1 JMX metric type $2" | ||
type: COUNTER | ||
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.+), node-id=(.+)><>(.+-avg|.+-rate) | ||
name: kafka_$2_$5 | ||
labels: | ||
clientId: "$3" | ||
nodeId: "$4" | ||
help: "Kafka $1 JMX metric type $2" | ||
type: GAUGE | ||
#kafka.connect:type=kafka-metrics-count,client-id="{clientid}" | ||
#kafka.consumer:type=consumer-fetch-manager-metrics,client-id="{clientid}" | ||
#kafka.consumer:type=consumer-coordinator-metrics,client-id="{clientid}" | ||
#kafka.consumer:type=consumer-metrics,client-id="{clientid}" | ||
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.*)><>(.+-total) | ||
name: kafka_$2_$4 | ||
labels: | ||
clientId: "$3" | ||
help: "Kafka $1 JMX metric type $2" | ||
type: COUNTER | ||
- pattern: kafka.(.+)<type=(.+)-metrics, client-id=(.*)><>(.+-avg|.+-bytes|.+-count|.+-ratio|.+-age|.+-flight|.+-threads|.+-connectors|.+-tasks|.+-ago) | ||
name: kafka_$2_$4 | ||
labels: | ||
clientId: "$3" | ||
help: "Kafka $1 JMX metric type $2" | ||
type: GAUGE | ||
#kafka.connect:type=connector-metrics,connector="{connector}" | ||
- pattern: 'kafka.connect<type=connector-metrics, connector=(.+)><>(connector-class|connector-type|connector-version|status): (.+)' | ||
name: kafka_connect_connector_$2 | ||
value: 1 | ||
labels: | ||
connector: "$1" | ||
$2: "$3" | ||
help: "Kafka Connect $2 JMX metric type connector" | ||
type: GAUGE | ||
#kafka.connect:type=connector-task-metrics,connector="{connector}",task="{task}<> status" | ||
- pattern: 'kafka.connect<type=connector-task-metrics, connector=(.+), task=(.+)><>status: ([a-z-]+)' | ||
name: kafka_connect_connector_task_status | ||
value: 1 | ||
labels: | ||
connector: "$1" | ||
task: "$2" | ||
status: "$3" | ||
help: "Kafka Connect JMX Connector task status" | ||
type: GAUGE | ||
#kafka.connect:type=task-error-metrics,connector="{connector}",task="{task}" | ||
#kafka.connect:type=source-task-metrics,connector="{connector}",task="{task}" | ||
#kafka.connect:type=sink-task-metrics,connector="{connector}",task="{task}" | ||
#kafka.connect:type=connector-task-metrics,connector="{connector}",task="{task}" | ||
- pattern: kafka.connect<type=(.+)-metrics, connector=(.+), task=(.+)><>(.+-total) | ||
name: kafka_connect_$1_$4 | ||
labels: | ||
connector: "$2" | ||
task: "$3" | ||
help: "Kafka Connect JMX metric type $1" | ||
type: COUNTER | ||
- pattern: kafka.connect<type=(.+)-metrics, connector=(.+), task=(.+)><>(.+-count|.+-ms|.+-ratio|.+-seq-no|.+-rate|.+-max|.+-avg|.+-failures|.+-requests|.+-timestamp|.+-logged|.+-errors|.+-retries|.+-skipped) | ||
name: kafka_connect_$1_$4 | ||
labels: | ||
connector: "$2" | ||
task: "$3" | ||
help: "Kafka Connect JMX metric type $1" | ||
type: GAUGE | ||
#kafka.connect:type=connect-worker-metrics,connector="{connector}" | ||
- pattern: kafka.connect<type=connect-worker-metrics, connector=(.+)><>([a-z-]+) | ||
name: kafka_connect_worker_$2 | ||
labels: | ||
connector: "$1" | ||
help: "Kafka Connect JMX metric $1" | ||
type: GAUGE | ||
#kafka.connect:type=connect-worker-metrics | ||
- pattern: kafka.connect<type=connect-worker-metrics><>([a-z-]+-total) | ||
name: kafka_connect_worker_$1 | ||
help: "Kafka Connect JMX metric worker" | ||
type: COUNTER | ||
- pattern: kafka.connect<type=connect-worker-metrics><>([a-z-]+) | ||
name: kafka_connect_worker_$1 | ||
help: "Kafka Connect JMX metric worker" | ||
type: GAUGE | ||
#kafka.connect:type=connect-worker-rebalance-metrics,leader-name|connect-protocol | ||
- pattern: 'kafka.connect<type=connect-worker-rebalance-metrics><>(leader-name|connect-protocol): (.+)' | ||
name: kafka_connect_worker_rebalance_$1 | ||
value: 1 | ||
labels: | ||
$1: "$2" | ||
help: "Kafka Connect $2 JMX metric type worker rebalance" | ||
type: UNTYPED | ||
#kafka.connect:type=connect-worker-rebalance-metrics | ||
- pattern: kafka.connect<type=connect-worker-rebalance-metrics><>([a-z-]+-total) | ||
name: kafka_connect_worker_rebalance_$1 | ||
help: "Kafka Connect JMX metric rebalance information" | ||
type: COUNTER | ||
- pattern: kafka.connect<type=connect-worker-rebalance-metrics><>([a-z-]+) | ||
name: kafka_connect_worker_rebalance_$1 | ||
help: "Kafka Connect JMX metric rebalance information" | ||
type: GAUGE | ||
#kafka.connect:type=connect-coordinator-metrics | ||
- pattern: kafka.connect<type=connect-coordinator-metrics><>(assigned-connectors|assigned-tasks) | ||
name: kafka_connect_coordinator_$1 | ||
help: "Kafka Connect JMX metric assignment information" | ||
type: GAUGE | ||
{{- end }} |
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,51 @@ | ||
{{- if .Values.monitoring.enabled }} | ||
{{- if .Values.monitoring.podMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: {{ printf "%s-metrics" (include "kafka-connect.name" .) }} | ||
labels: | ||
app: strimzi | ||
spec: | ||
selector: | ||
matchExpressions: | ||
- key: "strimzi.io/kind" | ||
operator: In | ||
values: ["Kafka", "KafkaConnect", "KafkaMirrorMaker", "KafkaMirrorMaker2"] | ||
namespaceSelector: | ||
matchNames: | ||
- {{ $.Release.Namespace }} | ||
podMetricsEndpoints: | ||
- path: /metrics | ||
port: tcp-prometheus | ||
relabelings: | ||
- separator: ; | ||
regex: __meta_kubernetes_pod_label_(strimzi_io_.+) | ||
replacement: $1 | ||
action: labelmap | ||
- sourceLabels: [__meta_kubernetes_namespace] | ||
separator: ; | ||
regex: (.*) | ||
targetLabel: namespace | ||
replacement: $1 | ||
action: replace | ||
- sourceLabels: [__meta_kubernetes_pod_name] | ||
separator: ; | ||
regex: (.*) | ||
targetLabel: kubernetes_pod_name | ||
replacement: $1 | ||
action: replace | ||
- sourceLabels: [__meta_kubernetes_pod_node_name] | ||
separator: ; | ||
regex: (.*) | ||
targetLabel: node_name | ||
replacement: $1 | ||
action: replace | ||
- sourceLabels: [__meta_kubernetes_pod_host_ip] | ||
separator: ; | ||
regex: (.*) | ||
targetLabel: node_ip | ||
replacement: $1 | ||
action: replace | ||
{{- end }} | ||
{{- end }} |
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