Can we reduce the metric name using legend option?

I want to shorten the metric name or i want to add particular part of the metric name to display it on the chart or table. Is there any method to do so?

for ex:

in above I want to remove the running and also the number present at the end.

Thanks in advance

Welcome to the Grafana forum.

What you describe is possible, but is done differently for different data sources. Which data source are you using?

  • Graphite: alias or aliasByNode function
  • Prometheus: “Legend format” field
  • InfluxDB: “Alias By” field

Ok… I am using Prometheus Data source


can you tell me the regex that can use for above one.

Thanks in advance

Hiii @grant2 ,

can you tell me the regex that can use for above one.

Thanks in advance

How about this?

Hii @grant2 ,

Its good, actually we dont want that number too in Running::armada-api-5ff69858bd-npnl6 we only want Running::armada-api.

In the similar way there are lots of strings there . can we apply any logic for all these strings using overrides?

Thanks in advance.

hi @grant2 ,

can we do the same using regex by name? if yes, could you please tell me regex to pull the desired the string.

if we can do with override, you have done for armada-api… but there are so many pods are there? how to do that… would you please help me

Hi @grant2 ,

Could you please help me ?

actually we can use override for a single one right. But here there are many names displaying, from each we should choose the required one.

Thanks in advance.