Hello,
Im using grafana and promethues and i created a dashboard, it all works fine but the dashboard display show this long expression and i want it to look clean.
so insteand on this long text i can choose the specific lable , how can i do this ?
Hi @batchenr ,
Since you have tags in legend you can use them if you change Legend from Auto to Custom.
Default:
Using Options -> Custom
:
If you want to extract only part of a tag and use that as legends please check this post:
Hi @ppxtb ,
In Transform tab (near Query) you can choose Rename by regex and for Match enter:
.*\(([^\)]+).*
and leave Replace as $1.
[Grafana regex]
Regex breakdown:
.* - means any symbol 0 or more times (basically means match anything)
\( - specifies that after anything there must be a literal symbol (
( - starts matching group
[^)]+ - means match anything until you find ) symbol
) - closes matching group
.* - matches anything till the end
Replace breakdown
$1 - means return wha…
Best regards,
ldrascic
1 Like