Search code examples
prometheuspromql

How to delete series that meet multiple conditions at the same time in prometheus?


Following query works for all with instances=127.0.0.1:9090:

curl -X POST -g 'http://127.0.0.1:9090/api/v1/admin/tsdb/delete_series?match[]={instance="127.0.0.1:9090"}'

Following query works for all with job=node:

curl -X POST -g 'http://127.0.0.1:9090/api/v1/admin/tsdb/delete_series?&match[]={job="node"}'

If I just want to delete series with instance=127.0.0.1:9090 and job=node, how can I query it?


Solution

  • Use the following query:

    curl -X POST -g 'http://127.0.0.1:9090/api/v1/admin/tsdb/delete_series?match[]={instance="127.0.0.1:9090", job="node"}'