-
What Grafana version and what operating system are you using?
Currently using 11.4.0 -
What are you trying to achieve?
We use Grafana in EKS. We use RDS instances. We use cloudwatch as a datasource in grafana to pull metrics from RDS. We are using a centralized grafana to pull metrics from multiple clusters. Our clusters run in different sub-accounts and our RDS instances run local to those sub-accounts.
In the dashboard, we have a drop-down to allow operators to select the cluster with the metrics they want to view. So I need to map the cluster (victoriametrics) to the cloudwatch RDS instance name and then write a “query” that will chain the variables so that the dashboard pulls metrics from the correct Cloudwatch RDS instance correlated with the cluster.
- How are you trying to achieve it?
I’ve created four variables so far:
- a standard variable for cluster pulled from prometheus (actually victoriametrics without the VM plugin for now)
- an instance_map (db instance map)
- a join variable which maps the cluster to the instance_map (this is the one that is failing miserably). The screenshot below shows empty fields and this is because grafana nullifies or empties the fields as soon as I save the dashboard or run the query (and typically with no errors). I’ll show a screenshot with how I’m trying to do this and then one with what happens after grafana empties the fields:
- Final variable for cloudwatch to use the selected instance
-
What happened?
Grafana clears the fields ininstance_map
and occasionally yields an error which I was unable to capture. The error is inconsistently shown. I’m not able to use the mapped db instance to cluster relationship. -
What did you expect to happen?
I expected the variable interpolation to work so I can relate the db instances to cluster names so that I can view cloudwatch telemetry for these DB instances. -
Can you copy/paste the configuration(s) that you are having problems with?
If they are required, I can try and get them and sanitize what needs to be sanitized if necessary. -
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
I did, but I was not able to capture them and they show up inconsistently such that I haven’t seen one in a while despite the failures described. If memory serves, it was something about the data source and thelabels_value
function not being available or valid or something, which made some sense to me. Where I’m not grasping thing is that I’m trying to use a variable as a source for a label which will then be used as a variable for a data source from cloudwatch. If I can reproduce the error, I’ll make sure and get it in this post. -
Did you follow any online instructions? If so, what is the URL?
Add variables | Grafana documentation
https://community.grafana.com/t/access-to-the-value-of-a-custom-variable-key-value-from-another-
custom-variable-value/118039/8