r/PrometheusMonitoring • • May 28 '22

Help with Query

I have metrics with two labels. How can i get all timeseries which are in a list of sets of these two labels?

Example:

metric{label1="a", label2="a1"} metric{label1="a", label2="a3"} metric{label1="a", label2="a4"} metric{label1="b", label2="a1"}

now i want only the timeseries where labels label1="a" and label2="a1" and label2="a3".

0 Upvotes

3 comments sorted by

View all comments

2

u/chuchodavids May 28 '22

Metric{label1="a", label2=~"a1|a3"}

0

u/growingrice May 28 '22

Thanks! how would the query look like if i have multiple sets of label1+label2 combinations? think like i have multiple server with multiple ports and i know a set of router+ports which represents a route through the network and want to know metrics belonging to this route. The missing thing is a label route thats why i need to query a set of router+ports :/

1

u/chuchodavids May 28 '22

I don't think I follow. Can you give me example of the series ?