How do I delete all data?

I tried:

  • Using the HTTP API.

    Deleting a series with a match operator such as

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

    works, but matching all series somehow doesn't. I tried:

    curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={}'
    curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job=~".+"}'
    curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={__name__=~".+"}'

    Both return without error, but the data remains unaffected.

  • Delete the data directory. Valid workaround, but requires prometheus to restart in order to become visible in grafana, which takes a long time, and I'm pretty sure that's not the intended way of doing it

Sources: 1, 2, 3, 4

New contributor
Nearoo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Nearoo is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.