vmstorage: persist metrics metadata on shutdown

Author: zekker6Created Sep 18, 2026Updated Sep 18, 2026
Labelsenhancement

Is your feature request related to a problem? Please describe

Currently, metrics metadata is only stored in-memory at vmstorage or single-node deployment. Restarting the component means loosing accumulated state.

In most cases metadata will be reconstructed at next scrape, so the data will be available within a few minutes.

In some cases scrape intervals are higher - 5 / 20 minutes or higher. That means loosing metadata for period of time which might be noticeable by the users who expect data to be available.

Describe the solution you'd like

It would be great if metadata would be persisted similar to metric names stats and restored after the restart.

Describe alternatives you've considered

No response

Additional information

It might be important to also have a staleness mechanism to prune metadata of entries which are no longer ingested to avoid unbound state growth. This is currently working as state only accumulates in memory, persisting whole state might lead to unbound growth of metadata over time.

Source: VictoriaMetrics/VictoriaMetrics