I'm not sure what you mean by "preserve prometheus snapshot" - AFAIK the snapshot remains forever until you delete it.
If you mean you want to delete snapshots when they reach a particular age, then you can do that yourself from a cronjob. e.g. for 90 days retention: find <data-dir>/snapshots -mtime +90 -type f -delete On Sunday 17 March 2024 at 14:52:49 UTC abhishek ellendula wrote: > Hi All > > Below is the way how we generally create snapshot. > > Snapshot > <https://prometheus.io/docs/prometheus/latest/querying/api/#snapshot> > > Snapshot creates a snapshot of all current data into > snapshots/<datetime>-<rand> under the TSDB's data directory and returns > the directory as response. It will optionally skip snapshotting data that > is only present in the head block, and which has not yet been compacted to > disk. > POST /api/v1/admin/tsdb/snapshot PUT /api/v1/admin/tsdb/snapshot > > URL query parameters: > > - skip_head=<bool>: Skip data present in the head block. Optional. > > $ curl -XPOST http://localhost:9090/api/v1/admin/tsdb/snapshot { > "status": "success", "data": { "name": "20171210T211224Z-2be650b6d019eb54" > } } > > The snapshot now exists at > <data-dir>/snapshots/20171210T211224Z-2be650b6d019eb54 > > But is there a any way or method to preserve prometheus snapshot for > specific time-period. > > Thanks > Abhishek > > > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/419a7604-38b2-49ae-af0c-43903333e5d1n%40googlegroups.com.

