rp346
rp346

Reputation: 7028

Grafana define Title value for chart

I am trying to create a dashboard. Able to generate Bar Gauge from the Prometheus data for simple query sum by (namespace) (kube_pod_container_status_running)

enter image description here

I want to display only Namespace rather than {namespace="kube-system"}, so was playing with Visualization > Field > Title for a while, but was not able to figure out.

enter image description here

Any Idea How can just display kube-system instead of {namespace="kube-system"} and make the list in sorted order, because everytime when i refresh the dashboard, it reshuffles the order.

What I need here ?

Upvotes: 1

Views: 1785

Answers (1)

Jan Garaj
Jan Garaj

Reputation: 28626

https://grafana.com/docs/grafana/latest/features/datasources/prometheus/

Legend format

Controls the name of the time series, using name or pattern. For example {{hostname}} will be replaced with label value for the label hostname.

=> configure Legend format in the Queries section and add {{namespace}} there.

I'm not sure about sort. You may try Prometheus sort/sort_desc function to sort query result.

Upvotes: 2

Related Questions