If I have matrics like this
my_metric{deployTime="1603284798",foo='bar'}
my_metric{deployTime="1603284799",foo='bar2'}
my_metric{deployTime="1603284800",foo='bar3'}
And I want to get only the metrics where the timestamp is greater than some value, how can I do it?
I was thinking of:
count by (deployTime, foo) (my_metric{deployTime > "1603284799", foo=~".*"})
but of course, this doesn't work as labels are strings. So what are my options to filter by label value if I want to use the greater than operator?
I don't know if I understood correctly but, do you have a label called "timestamp"? This seems to be unnecessary.
I think you can achieve what you want with the following query:
UPDATE
After you have clarified your question the answer is: unfortunately you can't query for labels using "greater than", "less than", etc.