title: Prometheus Grafana Templating order by count
body: <p>I am trying to put a dropdown for each API end point which will show the QPS and Latency of http requests (RED metrics).</p>
  
  <p>I used Grafana's templating and used the following prometheus query.</p>
  
  <pre><code>label_values(http_duration_milliseconds_count, api_path)
  </code></pre>
  
  <p>But the problem here is sort order. It shows some longtail api requests like /admin/phpMyAdmin all.</p>
  
  <p>I want to do only the top 10 endpoints by count to be shown in this drop down. How do I achieve this? </p>
  
  <p>Attached an image for reference on my first dashboard.</p>
  
  <p><a href="https://i.stack.imgur.com/GOhvb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GOhvb.png" alt="enter image description here"></a></p>