Setup Victoria Metrics Cluster with support of multiple retention periods within one installation.
Open Source Solution
Community version of VictoriaMetrics supports only one retention period per
vmstorage node via -retentionPeriod command-line flag.
A multi-retention setup can be implemented by dividing a victoriametrics cluster into logical groups with different retentions.
Example: Setup should handle 3 different retention groups 3months, 1year and 3 years. Solution contains 3 groups of vmstorages + vminserts and one group of vmselects. Routing is done by vmagent by splitting data streams. The -retentionPeriod sets how long to keep the metrics.
The diagram below shows a proposed solution
- Groups of vminserts A know about only vmstorages A and this is explicitly specified via
- Groups of vminserts B know about only vmstorages B and this is explicitly specified via
- Groups of vminserts C know about only vmstorages A and this is explicitly specified via
- Vmselect reads data from all vmstorage nodes via
- Vmagent routes incoming metrics to the given set of
vminsertnodes using relabeling rules specified at
Every group of vmstorages can handle one tenant or multiple one. Different groups can have overlapping tenants. As vmselect reads from all vmstorage nodes, the data is aggregated on its level.
You can set up vmauth for routing data to the given vminsert group depending on the needed retention.