Hello, I’m using the latest version of grafana. I’m trying to create a chain. I need to query a psql db to get variables to fill out my prometheus queries. I am already using psql variables on the dashboard. Here’s a nice visual to help see exactly what i’m doing:
The grafana label is fed in via a container_id variable, but how do I get the config variable I set in psql? I need it in that query A (second query). My grafana dashboard variables are already over complicating this issue and I just wish to grab the variable here. Let me know if you need any more details! I’ve really found this community so helpful! thanks in advanced!
Another option I have is to use this logic:
I can’t get the label to work. I want my grafana dashboard variable to be an entire row of data. Is there a way?
Can confirm, I get an entire row back… now how to access the data?
My grafana dashboard variable looks like this now:
$container_id:text = “Label”
$container_id:value=“(hash,id)”
In a prometheus query, how do I split this up so that I can just have the hash or just the id?
You can’t do that. Create dedicated (hidden) variable for hash and id and then use these 2 variables, where you need.
Hmm, I actually was able to get this chaining to work for individual selection. But this dashboard is supposed to display everything. I hate this issue because it’s so tricky
Here is my variable setup:
This works if the page has one container_id displayed, but when I repeat by container_id, I can’t display multiple panels. Example of problem:
what works →
container_id = 1
hash = 1kjdlj43403
aggregate →
container_id = 1+2
hash=None
It calculates the hash at the top of the page and not using the individual container_id’s in my panels… Ideas? Is there a way to move around when my hash is calculated? I’d love to just run psql queries in my panels and be able to easily get this data and then feed into my other queries?
I have no idea, what’s your problem - it’s hard to understand it. I recommend to rewrite problem in simple words with data example.
Ok, I tried to rewrite the problem here:
This is a different approach to the problem I’m having. I was hoping I could just run a psql query, get the string I needed, and then feed it into the prometheus query because the chained variables get tricky and I lose track.