title: Grafana Ad-hoc Filter with Prometheus query
body: <p>I have just started working on Grafana and Prometheus to develop a dashboard. In my Grafana dashboard, I am trying to add an Ad-hoc Filter that allows users to select the values from dropdown.</p>
  <p>Following is sample Prometheus data</p>
  <pre><code>Element                                                                                                                                ,  Value
  default_jenkins_builds_last_build_result{instance=&quot;jenkins-m1.abc.com&quot;,jenkins_m1_prod=&quot;XXX/YYYY/AAA&quot;,job=&quot;jenkins-m1&quot;,repo=&quot;ABC&quot;}, 0
  default_jenkins_builds_last_build_result{instance=&quot;jenkins-m2.abc.com&quot;,jenkins_m2_prod=&quot;XXX/YYYY/BBB&quot;,job=&quot;jenkins-m2&quot;,repo=&quot;BCD&quot;}, 0
  default_jenkins_builds_last_build_result{instance=&quot;jenkins-m1.abc.com&quot;,jenkins_m1_prod=&quot;XXX/YYYY/CCC&quot;,job=&quot;jenkins-m1&quot;,repo=&quot;ABCD&quot;},    0
  </code></pre>
  <p>I want to add an Ad-hoc filter for the <strong>instance label</strong> in Grafana. Below is an example of my current progress. You can see that I am not getting any results in the dropdown. I have also added the snippet of the configuration of the ad-hoc variable.</p>
  <p><a href="https://i.stack.imgur.com/in87c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/in87c.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/GqBev.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GqBev.png" alt="enter image description here" /></a></p>
  <p>I am assuming that somehow my query is incorrect which is why it is not returning any results. So, Can someone help me to get on the correct path where the dropdown should display two options from the above sample data &quot;jenkins-m1.abc.com&quot; and &quot;jenkins-m2.abc.com&quot;?</p>
  <p>Thanks</p>