0

I currently have a Prometheus where I am connected to Grafana.

When using the following PROMQL: instance_cpu_utilization{quantile="1", ClusterName="cluster-xxxx"} I have returned several Querys with tags that I don't need. Would there be any way to return only values that contain the quantile and ClusterName tags (Image 2)?

Image 1 Image 1

Image 2 Image 2

  • More detailed, when entering a current query in grafana it will return all the values ​​it contains as tags. My goal is for the query to be accurate, returning only "quantile" and "ClusterName". – Pablo Marques Aug 18 '23 at 05:05
  • 1
    Those are not tags, but labels. And what is returned are not queries, but time series. – markalex Aug 18 '23 at 06:05
  • If combination of quantile znd clustername are unque for every series - you can use any aggregation function, like `sum by` to drop out other labels. If they aren't unique - it's impossible. – markalex Aug 18 '23 at 06:07
  • But since you are using this query in grafana you probably do not need this at all. In most cases you can configure what labels are shown on your panel. What type of panel are you using? – markalex Aug 18 '23 at 06:09
  • Sum by would not answer, as it would add all the values. If you look at image 1 and 2, they are the same query. But the value I need (Red Arrow) It's on the last line. In summary, I wanted to understand if it is possible to make my query return only the specific result, ignoring the other labels. – Pablo Marques Aug 18 '23 at 17:42
  • Note how it is in grafana, I need information and I receive several.: https://i.imgur.com/rud1dLQ.png – Pablo Marques Aug 18 '23 at 17:43
  • 1
    Ah, you want series that doesn't have label `ContainerInstanceId`? Then you can use query `instance_cpu_utilization{quantile="1", ClusterName="cluster-xxxx", ContainerInstanceId=""}`. Did that help? – markalex Aug 18 '23 at 18:44

0 Answers0