# Using Custom Variables with prometheus fails to fetch all the series

**URL:** <https://community.grafana.com/t/using-custom-variables-with-prometheus-fails-to-fetch-all-the-series/104803>\
**Category:** Grafana\
**Tags:** templating\
**Created:** [October 3, 2023, 11:58am UTC](https://community.grafana.com/t/using-custom-variables-with-prometheus-fails-to-fetch-all-the-series/104803 "2023-10-03T11:58:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkominos](https://avatars.discourse-cdn.com/v4/letter/h/e9bcb4/32.png) [@hkominos](https://community.grafana.com/u/hkominos)\
**Post date:** [October 3, 2023, 11:58am UTC](https://community.grafana.com/t/using-custom-variables-with-prometheus-fails-to-fetch-all-the-series/104803/1 "2023-10-03T11:58:49Z")

</div>

Hi all! In my deployment of grafana 9.4.7 I see the following issue:

I have created a variable with a set of Key-Value pairs called **hpcflavors**  
(flavor1 : 102d211b-9617-44c3-9b1a-e33b755d4dec ,  
flavor2 : 102d221b-9617-44c3-9b1a-e33b755d4dec ,  
flavor3 : 08883aac-6ced-4d8b-97f5-7ab123d2d3c9…)

However when I use this variable to request data from prometheus, The query returns only on time series. More specifically

openstack\_nova\_server\_status{flavor\_id=~“${hpcflavors:pipe}”} returns time series for only 1 and not for every key. It looks like grafana is always picking hpcflavors[1] But I do not understand why. I have tried multiple approaches ,single-quotes, double quotes, avoid the use of pipe, using raw and many others.

If I go into the query inspector in the query payload, I see that grafana is sending only one of the variables  
(expr:“openstack\_nova\_server\_status{flavor\_id=~"102d221b-9617-44c3-9b1a-e33b755d4dec"}”)  
but I do not understand why,

It is clear that promethus is not at fault here because I can see in /metrics that there are different values that I am not seeing in my panel.

If I just do it in a dummy way  
openstack\_nova\_server\_status{flavor\_id=~“102d221b-9617-44c3-9b1a-e33b755d4dec|08883aac-6ced-4d8b-97f5-7ab8f0d2d3c9|1426efbd-695c-498d-bbc1-8edca29ff73e|1990a54a-1741-4f56-9245-5f3a1070082d|209d2847-43c5-4679-beab-8622824ef772”}  
The query works just fine.

Any input would be appreciated.
