Hi everyone,
I am trying to build a single unified dropdown variable in Grafana that filters panels coming from two different datasources:
1. vLLM Prometheus metrics
Models look like:
gpt-4o
gpt-4.1
o1-mini
2. AI Analysis API (Infinity datasource)
Models come as slugs:
gpt-4o-latest
gpt-4.1-preview
o1-mini-2024-12
Goal
I need ONE Grafana dropdown variable (for example: model) that can filter both:
-
Prometheus panels
-
Infinity datasource panels
at the same time.
Example:
If user selects gpt-4o, both panels should show only that modelβs data, regardless of how each datasource names it internally.
The problem
The naming between the two datasources is inconsistent:
| Prometheus (vLLM) | Infinity API slug |
|---|---|
| gpt-4o | gpt-4o-latest |
| gpt-4.1 | gpt-4.1-preview |
| o1-mini | o1-mini-2024-12 |
I need mapping like:
gpt-4o β gpt-4o-latest
gpt-4.1 β gpt-4.1-preview
o1-mini β o1-mini-2024-12
Constraints
These constraints make it difficult:
-
Custom variables only allow static comma-separated values (no mapping)
-
Query variables work only with:
-
Regex
-
Value β Text mapping
-
-
Infinity datasource does NOT allow variables inside jq parsing
-
I want one dropdown, not multiple variables
-
Need to access both values:
-
${model_prom} -
${model_api}
-
but I cannot define two linked variables automatically.
What I tried (and why it failed)
1. Defining a single variable with combined values
Example:
gpt-4o : gpt-4o-latest
gpt-4.1 : gpt-4.1-preview
Grafana ignores mapping inside Custom variables β fails.
2. Using regex in Query variable
Prometheus supports it, Infinity does not β fails.
3. Using transformations to rewrite variable values
Transformation UI does not expose variable context β fails.
4. Using Chained variables
Works only if the second variable can access the first,
but Infinity datasource prevents using ${var} in jq β fails.
5. Hard-coded mapping in JQ
Infinity parser canβt evaluate Grafana template variables β fails.
Iβve tried many mapping approaches, but Grafana always fails to read the variable in one of the two datasources.
The Question
How can I create ONE Grafana dropdown that selects a model and automatically maps it to:
-
the Prometheus model name
-
the Infinity API slug
so both datasource panels filter correctly?
Ideally, I need:
-
one variable like
${model} -
and automatically generate
${model_prom}+${model_api}
or something equivalent.
Is there a recommended Grafana pattern for cross-datasource variable mapping when variable substitution is partially unsupported?
If not, is there a known workaround for the Infinity datasource so it can use variables inside jq?
Any guidance, patterns, or examples would really help.
Thanks!
This is a blocker for making a unified dashboard, so any help from the community, Grafana engineers, or Infinity plugin maintainers would be very appreciated.

