From 6da1c85585aa2cd238aef3eeca88726bb8371f2f Mon Sep 17 00:00:00 2001 From: Chris Hain Date: Wed, 16 Apr 2025 14:25:21 -0700 Subject: [PATCH 1/2] fix for updated collector metric names --- .../otel-collector/collector-health.json | 65 +++---------------- 1 file changed, 8 insertions(+), 57 deletions(-) diff --git a/services/grafana/provisioning/dashboards/otel-collector/collector-health.json b/services/grafana/provisioning/dashboards/otel-collector/collector-health.json index 472dca3..9741fc9 100644 --- a/services/grafana/provisioning/dashboards/otel-collector/collector-health.json +++ b/services/grafana/provisioning/dashboards/otel-collector/collector-health.json @@ -1,53 +1,4 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "Prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.2.0" - }, - { - "type": "panel", - "id": "heatmap", - "name": "Heatmap", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - }, - { - "type": "panel", - "id": "text", - "name": "Text", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -75,7 +26,7 @@ "fiscalYearStartMonth": 0, "gnetId": 15983, "graphTooltip": 1, - "id": null, + "id": 48, "links": [], "liveNow": false, "panels": [ @@ -2268,7 +2219,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "max(otelcol_process_uptime${suffix}{service_instance_id=~\".*\",job=\"$job\"}) by (service_instance_id)", + "expr": "max(otelcol_process_uptime_seconds${suffix}{service_instance_id=~\".*\",job=\"$job\"}) by (service_instance_id)", "format": "time_series", "hide": false, "interval": "$minstep", @@ -2347,7 +2298,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(otelcol_process_uptime${suffix}{service_instance_id=~\".*\",job=\"$job\"}) by (service_instance_id,service_name,service_version)", + "expr": "max(otelcol_process_uptime_seconds${suffix}{job=\"$job\"}) by (instance, job)", "format": "table", "hide": false, "instant": true, @@ -3743,7 +3694,7 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "label_values(otelcol_process_memory_rss,job)", + "definition": "label_values(otelcol_process_memory_rss_bytes,job)", "hide": 0, "includeAll": false, "label": "Job", @@ -3752,7 +3703,7 @@ "options": [], "query": { "qryType": 1, - "query": "label_values(otelcol_process_memory_rss,job)", + "query": "label_values(otelcol_process_memory_rss_bytes,job)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, @@ -3958,7 +3909,7 @@ "type": "prometheus", "uid": "${datasource}" }, - "definition": "query_result({__name__=~\"otelcol_process_uptime.+\",job=\"$job\"})", + "definition": "query_result({__name__=~\"otelcol_process_uptime_seconds.+\",job=\"$job\"})", "description": "Some newer prometheusremotewrite exporter versions/configurations add _total suffix, so this hidden variable detects if _total suffix should be used or not", "hide": 2, "includeAll": false, @@ -3968,11 +3919,11 @@ "options": [], "query": { "qryType": 3, - "query": "query_result({__name__=~\"otelcol_process_uptime.+\",job=\"$job\"})", + "query": "query_result({__name__=~\"otelcol_process_uptime_seconds.+\",job=\"$job\"})", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, - "regex": "/otelcol_process_uptime(.*){.*/", + "regex": "/otelcol_process_uptime_seconds(.*){.*/", "skipUrlSync": false, "sort": 0, "type": "query" From 145ca7a75160d4333baa3aba6e1e3fcb18be5b24 Mon Sep 17 00:00:00 2001 From: Chris Hain Date: Wed, 16 Apr 2025 14:27:54 -0700 Subject: [PATCH 2/2] add back template sections --- .../otel-collector/collector-health.json | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/services/grafana/provisioning/dashboards/otel-collector/collector-health.json b/services/grafana/provisioning/dashboards/otel-collector/collector-health.json index 9741fc9..0f84143 100644 --- a/services/grafana/provisioning/dashboards/otel-collector/collector-health.json +++ b/services/grafana/provisioning/dashboards/otel-collector/collector-health.json @@ -1,4 +1,53 @@ { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -26,7 +75,7 @@ "fiscalYearStartMonth": 0, "gnetId": 15983, "graphTooltip": 1, - "id": 48, + "id": null, "links": [], "liveNow": false, "panels": [