Prometheus export / import data for backup

Arkon picture Arkon · Sep 21, 2017 · Viewed 12.3k times · Source

How do you export and import data in Prometheus? How do you make sure the data is backed up if the instance gets down?

It does not seem that there is a such feature yet, how do you do then?

Answer

Evgeny picture Evgeny · Oct 4, 2018

Since Prometheus version 2.1 it is possible to ask the server for a snapshot. The documentation provides more details - https://prometheus.io/docs/prometheus/2.1/querying/api/#snapshot

Once a snapshot is created, it can be copied somewhere for safe keeping and if required a new server can be created using this snapshot as its database.