Let's say that my system has been running for the past 45 days, starting on 
February 1st. I simply need the data for the 4th and 5th days of March.
How can i create snapshot which captures only 2 days data or any no of days.
To capture data for a specific duration, can you provide the URL query that 
takes time parameters, such as start and finish times. 


On Sunday, March 17, 2024 at 11:37:51 PM UTC+5:30 Brian Candler wrote:

> 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/46e7c7a6-6d3f-4794-957f-f9b90defc433n%40googlegroups.com.

Reply via email to