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.
This commit is contained in:
Vladyslav Miletskyi 2023-11-24 16:53:34 +01:00 committed by GitHub
parent 7f723c5985
commit 5f94f9164b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,14 +1,4 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__requires": [
{
"type": "grafana",