diff --git a/grafana_wtf/core.py b/grafana_wtf/core.py index 941f023..131f64e 100644 --- a/grafana_wtf/core.py +++ b/grafana_wtf/core.py @@ -663,10 +663,10 @@ def add(item): # Datasources defined as variables. if "type" in node and node["type"] == "datasource": values = to_list(node.get("current", {}).get("value")) - for ds_name in values: - datasource = self.datasource_by_name.get(ds_name) + for ds_uid in values: + datasource = self.datasource_by_uid.get(ds_uid) if datasource is None: - log.warning(f"Data source '{ds_name}' not found") + log.warning(f"Data source '{ds_uid}' not found") continue ds = dict( type=datasource.get("type"),