I have a metric which has an instance label whose value pattern like this:
cga-ops01.it.local:1000
cue-ops01.it.local:1000
cga-ops02.it.local:1000
cue-ops02.it.local:1000
cue-ops03.it.local:1000
The only part I care about is first part of the string before first -
char, and I want to group by this label to two groups with sum by
PromQL command:
- cga
- cue
Edit:
I created query:
sum by(infra) (
label_replace(
rate(wallet_operation_total[1m]), "infra", "cue", "instance", "cue-.*"
)
)
or
sum by(infra) (
label_replace(
rate(wallet_operation_total[1m]), "infra", "cga", "instance", "cga-.*"
)
)
The outcome is almost what the outcome of what I'm looking for, but there is a label value named "Value" and I don't know where it's coming from.