diff --git a/docs/Makefile b/docs/Makefile index 4b0f261cd7..96301a64e8 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,11 +1,10 @@ docs-install: gem install jekyll bundler bundle install --gemfile=Gemfile - +# To run localy you need to use ruby version =< 2.7.6, but not >=3.x , see https://bbs.archlinux.org/viewtopic.php?pid=1976408#p1976408 +# # run local server for documentation website # at http://127.0.0.1:4000/ # On first use, please run `make docs-install` docs-up: - JEKYLL_GITHUB_TOKEN=blank PAGES_API_URL=http://0.0.0.0 bundle exec \ - --gemfile=Gemfile \ - jekyll server --livereload + JEKYLL_GITHUB_TOKEN=blank PAGES_API_URL=http://0.0.0.0 bundle exec --gemfile=Gemfile jekyll serve --livereload diff --git a/docs/guides/README.md b/docs/guides/README.md index 12747cbd65..485989cbc1 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -11,3 +11,4 @@ sort: 26 5. [Multi Retention Setup within VictoriaMetrics Cluster](https://docs.victoriametrics.com/guides/guide-vmcluster-multiple-retention-setup.html) 6. [Migrate from InfluxDB to VictoriaMetrics](https://docs.victoriametrics.com/guides/migrate-from-influx.html) 7. [Multi-regional setup with VictoriaMetrics: Dedicated regions for monitoring](https://docs.victoriametrics.com/guides/multi-regional-setup-dedicated-regions.html) +8. [How to delete or replace metrics in VictoriaMetrics](https://docs.victoriametrics.com/guides/guide-delete-and-replace-metrics.html) diff --git a/docs/guides/guide-delete-or-replace-metrics.md b/docs/guides/guide-delete-or-replace-metrics.md new file mode 100644 index 0000000000..fd1d5e692b --- /dev/null +++ b/docs/guides/guide-delete-or-replace-metrics.md @@ -0,0 +1,236 @@ +# How to delete or replace metrics in VictoriaMetrics + +Data deletion is an operation people expect a database to have. [VictoriaMetrics](https://victoriametrics.com) supports +[delete operation](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-delete-time-series) but to a limited extent. Due to implementation details, VictoriaMetrics remains an [append-only database](https://en.wikipedia.org/wiki/Append-only), which perfectly fits the case for storing time series data. But the drawback of such architecture is that it is extremely expensive to mutate the data. Hence, `delete` or `update` operations support is very limited. In this guide, we'll walk through the possible workarounds for deleting or changing already written data in VictoriaMetrics. + +### Precondition + +- [Single-node VictoriaMetrics](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html); +- [Cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html); +- [curl](https://curl.se/docs/manual.html) +- [jq tool](https://stedolan.github.io/jq/) + +## How to delete metrics + +_Warning: time series deletion is not recommended to use on a regular basis. Each call to delete API could have a performance penalty. The API was provided for one-off operations to deleting malformed data or to satisfy GDPR compliance._ + +[Delete API](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-delete-time-series) expects from user to specify [time series selector](https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors). So the first thing to do before the deletion is to verify whether the selector matches the correct series. + +To check that metrics are present in **VictoriaMetrics Cluster** run the following command: + +_Warning: response can return many metrics, so be careful with series selector._ + +