Victoria Metrics: When Prometheus Runs Out of Room
When Prometheus Runs Out of Room
You've got Prometheus running, it's scraping your endpoints every 15 seconds, Grafana dashboards look great, and alerting is working. Life is good. Then someone asks "can we look at metrics from six months ago?" and you realize your retention is set to 15 days because anything longer made your disk usage uncomfortable.
Prometheus retention can be configured for longer periods, subject to storage and operational capacity. A separate backend such as VictoriaMetrics is an architectural option for retention, scaling or shared querying, not a prerequisite merely because data is older than 15 days.
What VictoriaMetrics actually is
VictoriaMetrics is a time-series database that can act as long-term storage for Prometheus, a complete replacement for it, or a standalone metrics backend. It speaks PromQL, accepts data via Prometheus remote write, and generally tries to be compatible enough that you can swap it in without rewriting all your queries and dashboards.
VictoriaMetrics provides open-source single-node and cluster editions. Clustering is not restricted to an enterprise license. Enterprise adds separately documented features; check the edition required for each feature rather than equating distributed deployment with paid software.
The core pitch is better resource efficiency. VictoriaMetrics uses compression algorithms designed specifically for time-series data, which typically means you can store more metrics for longer using less disk space than Prometheus would need. Whether the difference matters depends on your scale, but at high cardinality or long retention periods, it starts to add up.
The Prometheus relationship
Most people encounter VictoriaMetrics as a solution to Prometheus limitations rather than a replacement for Prometheus itself. The typical setup keeps Prometheus doing what it's good at (service discovery, scraping, short-term queries, alerting via Alertmanager) while offloading storage to VictoriaMetrics via remote write.
If you're still setting up Prometheus, our guide on building a monitoring stack with Docker Compose covers the initial setup.
The configuration is straightforward. In your prometheus.yml:
remote_write:
- url: http://victoriametrics:8428/api/v1/write
With a working remote-write connection, newly collected samples are forwarded to VictoriaMetrics. This does not automatically backfill older local data or move recording and alerting rules. Monitor queue lag and delivery failures, and use TLS/authentication outside a trusted private network.
Query the remote backend for its retained history and keep local retention according to your failure model. Test dashboards and rule results against both systems before migrating; compatible query syntax does not guarantee identical semantics.
Running it yourself
The single-node version is almost suspiciously easy to deploy. A Docker one-liner gets you started:
# Evaluation only: replace the placeholder with a tested release tag or digest.
docker run -d -p 127.0.0.1:8428:8428 \
-v victoria-metrics-data:/victoria-metrics-data \
--name victoriametrics \
victoriametrics/victoria-metrics:REPLACE_WITH_TESTED_VERSION \
-storageDataPath=/victoria-metrics-data -retentionPeriod=6
After choosing an actual supported image version, open http://127.0.0.1:8428/vmui/. The example retains six months and binds the published port to loopback. A Prometheus process or container needs a network route to this instance: victoriametrics resolves only when configured on a shared container network or DNS. Plan authentication, backups, resource limits and restore tests before production. See the single-node documentation.
Fivenines dashboards display data collected by Fivenines. They are not documented here as a direct frontend for an arbitrary VictoriaMetrics database; use a supported VictoriaMetrics client such as Grafana or VMUI for that backend.
The binary installation is similarly minimal. Download, run, point at a data directory. There's no external database dependency, no complex configuration file to write, no cluster coordination to set up. Single-node VictoriaMetrics is genuinely one process with one configuration.
When single-node isn't enough
The clustered version is a different beast. It splits into three component types: vminsert handles ingestion, vmstorage holds the data, and vmselect runs queries. You deploy multiple instances of each, typically behind load balancers, and they coordinate to distribute the workload.
This architecture scales horizontally, meaning you add capacity by running more instances rather than bigger machines. It's the approach you'd take when single-node performance hits its ceiling or when you need redundancy that a single process can't provide.
A cluster adds independently operated ingestion, storage and query components. Open-source replication is configurable; it is not an enterprise-only feature and does not replace backups. Confirm replication, deduplication, retention and any enterprise feature against the cluster documentation.
For most small to medium deployments, single-node is probably sufficient longer than you'd expect. The question of when to go clustered depends heavily on your ingestion rate, query patterns, and reliability requirements.
PromQL compatibility and its limits
VictoriaMetrics implements PromQL and adds some extensions (MetricsQL) that provide additional functions. For standard queries, you can generally copy them from Prometheus to VictoriaMetrics without changes. Grafana dashboards, alerting rules, and recording rules typically work as-is.
That said, "compatible" doesn't mean "identical." There are edge cases where behavior differs, especially around some of the more obscure PromQL features or specific error handling. If you're doing straightforward metric queries, you probably won't notice. If you've built complex recording rules that depend on subtle Prometheus behaviors, it's worth testing before assuming everything transfers cleanly.
The MetricsQL extensions are genuinely useful additions. Functions for label manipulation, additional aggregations, and some quality-of-life improvements that PromQL lacks. Whether you use them depends on how much you want to tie yourself to VictoriaMetrics specifically versus keeping queries portable.
The broader landscape
VictoriaMetrics isn't the only option in this space. Thanos and Cortex also solve the "Prometheus long-term storage" problem, with different architectural approaches. Thanos uses object storage (S3, GCS) and sidecars. Cortex is a horizontally scalable Prometheus-as-a-service design. InfluxDB is a more general time-series database that predates this whole ecosystem.
Each has trade-offs in complexity, cost, operational burden, and feature set. VictoriaMetrics tends to win on simplicity for the single-node case and on resource efficiency claims, though actual results vary by workload. The right choice depends on what you already have, what you're comfortable operating, and what specific problems you're trying to solve.
Who this makes sense for
If you're running Prometheus and hitting storage limitations, VictoriaMetrics is worth evaluating. The remote write integration means you can try it alongside your existing setup without committing to a full migration. Point a Grafana instance at it, let it collect a few weeks of data, and see if the query performance and storage characteristics work for your needs.
For a broader overview of what metrics to collect in the first place, see our guide on Linux server monitoring.
It's also a reasonable choice if you're starting fresh and want something Prometheus-compatible but with better long-term retention out of the box. The single-node deployment is simple enough that the operational overhead is minimal.
For very large scale deployments, the clustered version competes with other distributed time-series solutions, but at that point you're doing serious evaluation work regardless of which system you choose.
If you're already using a monitoring platform that handles metrics storage for you (whether that's a managed Prometheus service, Datadog, or something simpler like FiveNines for basic server metrics), the value proposition is less clear. VictoriaMetrics solves a specific problem around self-hosted metrics at scale, and if you don't have that problem, you might not need the solution.