Does Grafana Query Variable support time range in query

We are using grafana version 8.5.0 and we have prometheus and VictoriaMetrics as our data source. Both support PromQL like query.

I’m trying to use a query variable with this query.
label_values(some_metric, pod)

My grafana dashboard’s query range is already outside of the time range when the metric has data. However, I’m still seeing a value on the query variable drop down.

I would like this behaviour to be dynamic based on my time range. E.g If the time range had metric data then the dropdown will list out the existing values, else the dropdown should remain empty. How can I achieve this with a Prometheus data source?

It shouldnt be getting all distinct value that ever occurred for a metric from the oldest data point.

User will not know when the label value existed in time in this case.

1 Like

Did you ever get this solved?