From be65cf8052dea22cd8fc126ebd55ab0ab0f44025 Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Thu, 6 May 2021 10:20:48 +0100 Subject: [PATCH] Change labels in prometheus and grafana dashboard Signed-off-by: Somtochi Onyekwere --- .../grafana/dashboards/control-plane.json | 22 +++++++++---------- manifests/monitoring/grafana/deployment.yaml | 2 +- .../monitoring/prometheus/deployment.yaml | 2 +- .../monitoring/prometheus/prometheus.yml | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/manifests/monitoring/grafana/dashboards/control-plane.json b/manifests/monitoring/grafana/dashboards/control-plane.json index 620451ad..463ca7e1 100644 --- a/manifests/monitoring/grafana/dashboards/control-plane.json +++ b/manifests/monitoring/grafana/dashboards/control-plane.json @@ -67,7 +67,7 @@ "pluginVersion": "7.1.1", "targets": [ { - "expr": "sum(go_info{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"})", + "expr": "sum(go_info{namespace=\"$namespace\",pod=~\".*-controller-.*\"})", "interval": "", "legendFormat": "pods", "refId": "A" @@ -130,7 +130,7 @@ "pluginVersion": "7.1.1", "targets": [ { - "expr": "max(workqueue_longest_running_processor_seconds{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"})", + "expr": "max(workqueue_longest_running_processor_seconds{namespace=\"$namespace\",pod=~\".*-controller-.*\"})", "hide": false, "interval": "", "legendFormat": "seconds", @@ -192,7 +192,7 @@ "pluginVersion": "7.1.1", "targets": [ { - "expr": "sum(go_memstats_alloc_bytes{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"})", + "expr": "sum(go_memstats_alloc_bytes{namespace=\"$namespace\",pod=~\".*-controller-.*\"})", "interval": "", "legendFormat": "", "refId": "A" @@ -256,7 +256,7 @@ "pluginVersion": "7.1.1", "targets": [ { - "expr": "sum(rate(rest_client_requests_total{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"}[1m]))", + "expr": "sum(rate(rest_client_requests_total{namespace=\"$namespace\",pod=~\".*-controller-.*\"}[1m]))", "interval": "", "legendFormat": "requests", "refId": "A" @@ -329,20 +329,20 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(0.50, sum(rate(rest_client_request_latency_seconds_bucket{kubernetes_namespace=\"$namespace\"}[5m])) by (le))", + "expr": "histogram_quantile(0.50, sum(rate(rest_client_request_latency_seconds_bucket{namespace=\"$namespace\"}[5m])) by (le))", "interval": "", "legendFormat": "P50", "refId": "A" }, { - "expr": "histogram_quantile(0.90, sum(rate(rest_client_request_latency_seconds_bucket{kubernetes_namespace=\"$namespace\"}[5m])) by (le))", + "expr": "histogram_quantile(0.90, sum(rate(rest_client_request_latency_seconds_bucket{namespace=\"$namespace\"}[5m])) by (le))", "hide": true, "interval": "", "legendFormat": "P90", "refId": "B" }, { - "expr": "histogram_quantile(0.99, sum(rate(rest_client_request_latency_seconds_bucket{kubernetes_namespace=\"$namespace\"}[5m])) by (le))", + "expr": "histogram_quantile(0.99, sum(rate(rest_client_request_latency_seconds_bucket{namespace=\"$namespace\"}[5m])) by (le))", "hide": false, "interval": "", "legendFormat": "P99", @@ -441,14 +441,14 @@ "steppedLine": false, "targets": [ { - "expr": "sum(rate(rest_client_requests_total{kubernetes_namespace=\"$namespace\"}[1m]))", + "expr": "sum(rate(rest_client_requests_total{namespace=\"$namespace\"}[1m]))", "hide": false, "interval": "", "legendFormat": "total", "refId": "A" }, { - "expr": "sum(rate(rest_client_requests_total{kubernetes_namespace=\"$namespace\",code!~\"2..\"}[1m]))", + "expr": "sum(rate(rest_client_requests_total{namespace=\"$namespace\",code!~\"2..\"}[1m]))", "hide": false, "interval": "", "legendFormat": "errors", @@ -545,7 +545,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(process_cpu_seconds_total{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"}[1m])", + "expr": "rate(process_cpu_seconds_total{namespace=\"$namespace\",pod=~\".*-controller-.*\"}[1m])", "interval": "", "legendFormat": "{{kubernetes_pod_name}}", "refId": "A" @@ -640,7 +640,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(go_memstats_alloc_bytes_total{kubernetes_namespace=\"$namespace\",kubernetes_pod_name=~\".*-controller-.*\"}[1m])", + "expr": "rate(go_memstats_alloc_bytes_total{namespace=\"$namespace\",pod=~\".*-controller-.*\"}[1m])", "hide": false, "interval": "", "legendFormat": "{{kubernetes_pod_name}}", diff --git a/manifests/monitoring/grafana/deployment.yaml b/manifests/monitoring/grafana/deployment.yaml index 99d028ba..d53d66b6 100644 --- a/manifests/monitoring/grafana/deployment.yaml +++ b/manifests/monitoring/grafana/deployment.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: grafana - image: "grafana/grafana:7.2.1" + image: "grafana/grafana:7.5.4" imagePullPolicy: IfNotPresent ports: - name: http diff --git a/manifests/monitoring/prometheus/deployment.yaml b/manifests/monitoring/prometheus/deployment.yaml index 355986d8..293a9353 100644 --- a/manifests/monitoring/prometheus/deployment.yaml +++ b/manifests/monitoring/prometheus/deployment.yaml @@ -19,7 +19,7 @@ spec: serviceAccountName: prometheus containers: - name: prometheus - image: prom/prometheus:v2.21.0 + image: prom/prometheus:v2.26.0 imagePullPolicy: IfNotPresent args: - '--storage.tsdb.retention=2h' diff --git a/manifests/monitoring/prometheus/prometheus.yml b/manifests/monitoring/prometheus/prometheus.yml index ca72bf8b..93f35c09 100644 --- a/manifests/monitoring/prometheus/prometheus.yml +++ b/manifests/monitoring/prometheus/prometheus.yml @@ -45,8 +45,8 @@ scrape_configs: - action: replace source_labels: - __meta_kubernetes_namespace - target_label: kubernetes_namespace + target_label: namespace - action: replace source_labels: - __meta_kubernetes_pod_name - target_label: kubernetes_pod_name + target_label: pod