Limit labels returned from Query

1,122 views
Skip to first unread message

Marcus Morris

unread,
Jul 5, 2016, 2:27:41 AM7/5/16
to Prometheus Developers
Sorry about all the questions. Just jumped back into this and a lot has changed since I first touched it.

I am using Grafana now (loving it) and I have a query that returns the Top 5 memory using containers. The query returns elements like this:

container_memory_usage_bytes{id="/docker/ff3981dwdadawd32d23d23d23d",image="company/image:qa-latest",instance="dev",job="container",name="image-latest",service_name="image",service_tags="qa"}

The problem with this is that all of those labels are shown in Grafana in the Legend and on hover which makes seeing useful info (such as just the 'image' label) very difficult:

http://imgur.com/0tddzAg

With the Prometheus hover over, it separates labels nicely:

http://imgur.com/PPP3qsx

Now I'm not sure if this is a question for you or for the Grafana team, but I figured I'd start at the source: Is there a way to limit what labels are returned from a query? So for example I could just have the 'image' label returned and then everything would be much easier to read.

Thanks for the continued help as I stumble through this.

Matthias Rampke

unread,
Jul 5, 2016, 2:37:41 AM7/5/16
to Marcus Morris, Prometheus Developers
Hi,

don't limit what labels are returned, simply use the Legend format in
Grafana (on the metrics screen of the panel settings) to customize the
display. For example, with a legend format like

`{{service_name}}[{{service_tags}}] {{name}}`

the legend will show

`image[qa] image-latest`

/MR
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-devel...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Matthias Rampke
Engineer

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany | +49
173 6395215

Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B
Reply all
Reply to author
Forward
0 new messages