From 5f94f9164b77e0fcd10afb2aac310347bf272e8c Mon Sep 17 00:00:00 2001 From: Vladyslav Miletskyi <33529567+Vladyslav-Miletskyi@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:53:34 +0100 Subject: [PATCH] fix(grafana/dashboard): dashboard to use datasource variable ## Bug Reproduction Prerequisites The bug could be observed exclusively in scenarios involving multiple Prometheus datasources. ## Root Cause Analysis Upon importing a dashboard, Grafana replaces all `${DS_PROMETHEUS}` placeholders with the specified datasource. Issue arises due to the presence of a dashboard variable named `DS_PROMETHEUS`. Grafana substitutes variable invocations with the provided datasource, effectively hardcoding it during the import process. Consequently, if a user later selects a different datasource, this change does not impact the dashboard since the datasource value was **hardcoded during the initial import**. ## Proposed Fix The proposed solution eliminates the reliance on the DS_PROMETHEUS variable as an input during the import process. Instead, the fix involves depending on the provided variable, ensuring a more dynamic and adaptable integration with various datasources post-import. --- deploy/grafana/dashboards/nginx.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/deploy/grafana/dashboards/nginx.json b/deploy/grafana/dashboards/nginx.json index 3c3205b4a..4c5db2aee 100644 --- a/deploy/grafana/dashboards/nginx.json +++ b/deploy/grafana/dashboards/nginx.json @@ -1,14 +1,4 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "Prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], "__requires": [ { "type": "grafana",