You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to use data from multiple Prometheus instances without manually rewriting the database: simply copy blocks from one Prometheus data directory to the target Prometheus data directory.
For example, Prometheus data directories usually look like this:
In this case the first 3 subdirectories starting with 01HQ* are blocks that have been compacted.
The main caveat is this works well enough for already compacted TSDB blocks, but it doesn't necessarily work well for the head block (the block that holds the most recent data), and so there is a chance we are losing the last ~2 hours of the Prometheus databases we are merging.
It would be ideal if we can simply flush the head block with the Prometheus API or with promtool. There are a number of proposals, but nothing that looks like it has made it to Prometheus yet.
Alternatives I'm thinking of are playing with snapshots to force writing the head block, or forcing it directly with a custom tool that calls FlushWAL() on the Prometheus database. While not perfect, this approach to combining multiple Prometheus databases is more promising than other options.
This issue is meant to keep track of progress and findings related to this topic.
The text was updated successfully, but these errors were encountered:
It is possible to use data from multiple Prometheus instances without manually rewriting the database: simply copy blocks from one Prometheus data directory to the target Prometheus data directory.
For example, Prometheus data directories usually look like this:
In this case the first 3 subdirectories starting with
01HQ*
are blocks that have been compacted.The main caveat is this works well enough for already compacted TSDB blocks, but it doesn't necessarily work well for the head block (the block that holds the most recent data), and so there is a chance we are losing the last ~2 hours of the Prometheus databases we are merging.
It would be ideal if we can simply flush the head block with the Prometheus API or with promtool. There are a number of proposals, but nothing that looks like it has made it to Prometheus yet.
Alternatives I'm thinking of are playing with snapshots to force writing the head block, or forcing it directly with a custom tool that calls
FlushWAL()
on the Prometheus database. While not perfect, this approach to combining multiple Prometheus databases is more promising than other options.This issue is meant to keep track of progress and findings related to this topic.
The text was updated successfully, but these errors were encountered: