Chaining prometheus and loki variables

Hi,

I’m trying to create a dynamic dashboard that can redirect users to Loki logs. So there is a panel that shows 5xx responses and I want to add a data link that points to the logs. We are using Prometheus to monitor the HTTP requests and I’m using the Prometheus ENV variable to set the data source on the dashboard. Is there a simple way to connect the selection of our Prometheus env to the Loki Env. When I select Prom-Prod, automatically the Loki-Prod variable is chosen.

I’m using Grafana v9.0.4

simple way…

not sure. but people do wild stuff with data-links and chained variables. Here are some resources:

It sounds like you want to use chained variables. Here are some useful starting points and example dashboards in our public sandbox :+1:

also, you should check out using Explore and not using dashboards. Explore is built specifically for this sort of metrics-to-logs-to-traces sort of workflows. You can do super cool stuff with it, especially when using prom + loki + tempo