1

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 ?

roy
  • 6,344
  • 24
  • 92
  • 174

1 Answers1

2

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.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59