victoriametrics

How to delete a monthly partition from VictoriaMetrics vmstore nodes


We are backfilling old data into our VictoriaMetrics and Grafana setup. But we might have messed up the data on a month. We want to delete a monthly partition from vmstore nodes and start again. Is this possible through the APIs?


Solution

  • Yep, you can do this via VictoriaMetrics Delete API /api/v1/admin/tsdb/delete_series. Note, that you can only delete All of the data and restore/backfill ones again.

    See examples below:

    Single-node VictoriaMetrics

    curl -v http://localhost:8428/api/v1/admin/tsdb/delete_series -d 'match[]=your_metric_name_here'

    Cluster version of VictoriaMetrics

    curl -v http://<vmselect>:8481/delete/0/prometheus/api/v1/admin/tsdb/delete_series -d 'match[]=your_metric_name_here'

    VictoriaMetrics documentation has a guide "How to delete or replace metrics in VictoriaMetrics" with more explanation and examples.