RJtokenring
RJtokenring

Reputation: 479

Victoria metrics - metrics associated to a label

I need to get all metrics associated to a labels from Victoria Metrics. Something like:

GET /api/v1/series?match[]=series

but the ability to provide a label selector in the match. Like:

match[]={jobname="abc"}

I need to extract all name metrics associated to label {jobname="abc"}

Is it possible?

Thanks!!

Upvotes: 0

Views: 2983

Answers (1)

valyala
valyala

Reputation: 18010

Try the following query:

GET /api/v1/label/__name__/values?match[]={jobname="abc"}&start=...&end=...

It should return all the metric names with the label {jobname="abc"} on the time range start ... end. The start and end args may have the following forms:

  • Unix timestamp in seconds.
  • Time relative to the current time. For example, start=-1h means now - 1 hour timestamp
  • RFC3339 timestamp. For example, 2020-03-15T10:30:59Z

Upvotes: 1

Related Questions