From f3682b80145b62d048e34f4149d0e6c13d701666 Mon Sep 17 00:00:00 2001 From: Daniel Petisme Date: Fri, 26 May 2023 11:43:35 +0200 Subject: [PATCH] Adding cluster linking metrics --- roles/kafka_broker/templates/kafka.yml.j2 | 83 +++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/roles/kafka_broker/templates/kafka.yml.j2 b/roles/kafka_broker/templates/kafka.yml.j2 index 977db0959..04803e2bb 100644 --- a/roles/kafka_broker/templates/kafka.yml.j2 +++ b/roles/kafka_broker/templates/kafka.yml.j2 @@ -19,6 +19,18 @@ blacklistObjectNames: - "kafka.server:type=*,cipher=*,protocol=*,listener=*,networkProcessor=*" - "kafka.server:type=*" rules: + # Needed for Cluster Linking metrics + # This rule is more specific than the next rule; it has to come before it otherwise it will never be hit + # "kafka.server:type=*, name=*, client-id=*, topic=*, partition=*, link-name=*" + - pattern: kafka.server<>Value + name: kafka_server_$1_$2 + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + clientId: "$3" + topic: "$4" + partition: "$5" + linkName: "$6" # The other Cluster Linking metrics are using the "link-name" syntax # This rule is more specific than the next rule; it has to come before it otherwise it will never be hit # "kafka.server:type=*, name=*, client-id=*, topic=*, partition=*" - pattern: kafka.server<>Value @@ -187,6 +199,77 @@ rules: cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} labels: quantile: "0.$4" + # Needed for Cluster Linking metrics + # kafka.server.link:type=ClusterLinkFetcherManager,name=*,clientId=&,link-name=* + - pattern : kafka.server.link<>Value + name: kafka_server_link_clusterlinkfetchermanager_$1 + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + "$2": "$3" + "$4": "$5" + # kafka.server:type=cluster-link,link-name=* + - pattern : kafka.server<>(fetch-throttle-time-avg|fetch-throttle-time-max) + name: kafka_server_cluster_link_$3 + type: GAUGE + labels: + "$1": "$2" + # kafka.server:type=cluster-link-metadata-metrics,link-name=*, mechanism=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_metadata_metrics_$5 + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + "$1": "$2" + "$3": "$4" + # kafka.server:type=cluster-link-fetcher-metrics,link-name=*,broker-id=*,fetcher-id=*, mechanism=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_fetcher_metrics_$9 + type: GAUGE + labels: + "$1": "$2" + "$3": "$4" + "$5": "$6" + "$7": "$8" + # kafka.server:type=cluster-link-fetcher-metrics,link-name=*,broker-id=*,fetcher-id=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_fetcher_metrics_$7 + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + "$1": "$2" + "$3": "$4" + "$5": "$6" + # kafka.server:type=cluster-link-metrics, mode=*, state=*, link-name=*, name=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_metrics_$7 + type: GAUGE + labels: + "$1": "$2" + "$3": "$4" + "$5": "$6" + # kafka.server:type=cluster-link-metrics,state=*,link-name=*,name=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_metrics_$5 + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + "$1": "$2" + "$3": "$4" + # kafka.server:type=cluster-link-metrics,name=*,link-name=* + - pattern : 'kafka.server<>(.+):' + name: kafka_server_cluster_link_metrics_$3 + type: GAUGE + labels: + "$1": "$2" + # kafka.server:type=cluster-link-source-metrics,request=*,link-id=* + - pattern : kafka.server<>Value + name: kafka_server_cluster_link_source_metrics + type: GAUGE + cache: {{ kafka_broker_jmxexporter_bean_name_expressions_cache | lower }} + labels: + "$1: "$2" + "$3": "$4" # Additional Rules for Confluent Server Metrics # 'confluent.metadata:type=*, name=*, topic=*, partition=*' - pattern: confluent.(\w+)<>Value