From b110a5d6d28e016539316d6be45d1d1d186ec4d0 Mon Sep 17 00:00:00 2001
From: Simon Ehrenstein <simon.ehrenstein@gmail.com>
Date: Thu, 17 Feb 2022 12:32:29 +0100
Subject: [PATCH] Start to replace metrics

---
 .../grafana/dashboard-config-map.yaml         |  6 ++--
 helm/templates/strimzi/kafka-podmonitor.yaml  | 29 -------------------
 2 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/helm/templates/grafana/dashboard-config-map.yaml b/helm/templates/grafana/dashboard-config-map.yaml
index 0df01b20e..ace873e80 100644
--- a/helm/templates/grafana/dashboard-config-map.yaml
+++ b/helm/templates/grafana/dashboard-config-map.yaml
@@ -71,7 +71,7 @@ data:
         "steppedLine": false,
         "targets": [
           {
-            "expr": "sum(cp_kafka_server_brokertopicmetrics_messagesinpersec_topic_input)",
+            "expr": "sum(kafka_server_brokertopicmetrics_messagesin_total{topic='input'})",
             "format": "time_series",
             "intervalFactor": 1,
             "legendFormat": "{{Messages In Per Second}}",
@@ -162,7 +162,7 @@ data:
         "steppedLine": false,
         "targets": [
           {
-            "expr": "sum(cp_kafka_server_brokertopicmetrics_messagesinpersec_topic_output)",
+            "expr": "sum(kafka_server_brokertopicmetrics_messagesin_total{topic='output'})",
             "format": "time_series",
             "intervalFactor": 1,
             "legendFormat": "{{Messages Out Per Second}}",
@@ -253,7 +253,7 @@ data:
         "steppedLine": false,
         "targets": [
           {
-            "expr": "sum by(group, topic) (kafka_consumergroup_group_lag >= 0)",
+            "expr": "sum by(group, topic) (kafka_consumergroup_lag >= 0)",
             "format": "time_series",
             "intervalFactor": 1,
             "legendFormat": "{{topic}}",
diff --git a/helm/templates/strimzi/kafka-podmonitor.yaml b/helm/templates/strimzi/kafka-podmonitor.yaml
index 56f5c37a3..27e89c8b6 100644
--- a/helm/templates/strimzi/kafka-podmonitor.yaml
+++ b/helm/templates/strimzi/kafka-podmonitor.yaml
@@ -15,32 +15,3 @@ spec:
   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
-- 
GitLab