Relabel legend values returned from count_values()

I have query like:

count_values ("Stage", max by (instance) (stage))

Stage is an integer value so I get number of instances by stage, like:

  • 1 → 3
  • 2 → 10
  • 3 → 20
  • 5 → 5

How do I relabel stage values (1, 2, 3, 5) with some human-readable string in my charts.

welcome to the :grafana: forum, @greiftomas

sounds like you’re interested in using value mapping: