Skip to content

Instantly share code, notes, and snippets.

@atomlab
Last active February 18, 2024 08:56
Show Gist options
  • Save atomlab/14488d9ddac57610edf513b7fc348dca to your computer and use it in GitHub Desktop.
Save atomlab/14488d9ddac57610edf513b7fc348dca to your computer and use it in GitHub Desktop.
Delete data from Prometheus

starting the server with the option

--web.enable-admin-api

Prometheus

# delete alerts series
curl -v -X POST -g 'http://localhost:9090/api/v2/admin/tsdb/delete_series?match[]=ALERTS'

# delete data from disk
curl -v -X POST -g  http://localhost:9090/api/v2/admin/tsdb/clean_tombstones

Victoria Metrics

curl -v -X POST -g 'http://localhost:8428/api/v1/admin/tsdb/delete_series?match[]={job="http_check"}'
curl -v -X POST -g 'http://localhost:8428/api/v1/admin/tsdb/delete_series?match[]={host="seever01"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment