0

I have a metric that looks like this:

my_metric{index_name="cool_index_2021-10-03"} 1

And of course the date changes every day. I want to dynamically query this metric for today only, using the label index_name.

Is it possible to do something like this? (of course this is not working):

my_metric{index_name="cool_index_" + year() + "-" + month() + "-" + day()}
Moshe
  • 4,635
  • 6
  • 32
  • 57

1 Answers1

0

No, it is not possible. You could use a separate programming language to construct the queries and call the query API. Or, drop the index_name filter and use the query from this answer to group by day.

Levi Harrison
  • 493
  • 3
  • 10