add an alias for label

886 views
Skip to first unread message

Evelyn Pereira Souza

unread,
Aug 9, 2021, 1:06:13 PM8/9/21
to Prometheus Users
Hi

I add labels to each target.

This way i can filter the targets with labels in the alerts.

Now i want to add two values for a label (something like an alias).

for a query i should be able to filter by both values. No matter if i
take the orginal label or the alias, the result should be the same.

---
- labels:
env: Test
service: Controller
targets:
- https://example.org:8096

kind regards
Evelyn
OpenPGP_0x61776FA8E38403FB.asc
OpenPGP_signature

Brian Candler

unread,
Aug 9, 2021, 1:19:46 PM8/9/21
to Prometheus Users
Labels are single valued.

Depending on what you're trying to do, you can:
- add two different labels (and make two queries)
- combined the values together into a single label, and use a regular expression when searching
- make separate timeseries which have the aliases, and join on that in the query

For more info on the latter see

Evelyn Pereira Souza

unread,
Aug 11, 2021, 12:32:06 PM8/11/21
to promethe...@googlegroups.com
On 09.08.21 19:19, Brian Candler wrote:
> Labels are single valued.

ok. Thanks.

kind regards
Evelyn
OpenPGP_0x61776FA8E38403FB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages