Prompt
How do I migrate metrics from Prometheus to a time-series database?
Latest observation
Migrating metrics from Prometheus to a time-series database (TSDB) usually means one of two things:
- Keep Prometheus as the collector, but store long-term data in another TSDB.
- Replace Prometheus storage entirely with a different metrics backend.
The safest approach is usually #1: keep Prometheus scraping/exporting as-is, and add a remote storage backend or migration path.
Typical migration options
1) Use Prometheus remote_write
Prometheus can send samples to supported backends via remote_write.
Common backends:
- Thanos Receive / Thanos sidecar + object storage
- Grafana Mimir
- Cortex
- VictoriaMetrics
- InfluxDB (via adapters, depending on version/setup)
- OpenTSDB via adapters or bridges
This is the most common way to migrate without changing instrumentation.
2) Export/import historical data
If you need to move already-collected data:
- Use Prometheus data block tooling or snapshotting where supported
- Export from one system and import into the target TSDB if it supports it
- Often historical migration is partial, because not all TSDBs support direct import of Prometheus TSDB blocks
3) Re-ingest from exporters into the new TSDB
If your metrics are still being exposed by apps/exporters:
- Deploy the new TSDB’s scraper/collector
- Point it at the same scrape targets
- Recreate recording rules, dashboards, and alerts
This is common when you want to fully switch away from Prometheus.
Recommended migration plan
Step 1: Inventory your metrics setup
Document:
- Prometheus scrape targets
- Recording rules
- Alerting rules
- Retention period
- High-cardinality metrics
- Label conventions
- Dashboards depending on PromQL
Step 2: Pick your target TSDB
Decide based on:
- Native Prometheus compatibility
- Query language compatibility
- Long-term storage
- Multi-tenancy
- Cost and scale
- Operational complexity
Examples:
- Mimir/Thanos/VictoriaMetrics if you want Prometheus-like workflows
- InfluxDB if you want a different ecosystem and query model
Step 3: Validate metric compatibility
Check:
- Metric name and label cardinality limits
- Counter/gauge/histogram support
- Native histograms support if you use them
- Retention and downsampling behavior
- PromQL compatibility, if needed
Step 4: Start dual-writing or dual-scraping
For low-risk migration:
- Keep Prometheus running
- Send metrics to the new backend as well
- Compare:
- sample counts
- query results
- alert behavior
- dashboard rendering
Step 5: Migrate alerts and dashboards
- Translate PromQL if the new TSDB uses a different query language
- Recreate recording rules
- Validate alert thresholds and evaluation intervals
Step 6: Cut over gradually
- Start by using the new TSDB for read-only dashboards
- Then move alerting
- Then deprecate Prometheus storage if the new system is stable
Step 7: Monitor after cutover
Check:
- ingestion lag
- dropped samples
- label explosion
- storage growth
- query latency
- alert fidelity
Important considerations
Cardinality
Prometheus metrics with too many label combinations can overwhelm TSDBs. Before migration:
- remove unnecessary labels
- aggregate where possible
- avoid user IDs, request IDs, or other unbounded labels
Histograms
If you use Prometheus histograms:
- confirm the new TSDB supports them well
- verify bucket handling and quantile queries
Retention and cost
Different TSDBs handle:
- compression
- compaction
- downsampling
- object storage
- sharding differently, so costs can vary a lot.
Query language differences
PromQL support may be:
- full
- partial
- translated
- unavailable
This affects dashboards and alerts the most.
A practical example: Prometheus to VictoriaMetrics
A common migration path is:
- Leave Prometheus scraping targets
- Configure
remote_writeto VictoriaMetrics - Optionally use
vmagentfor scraping instead of Prometheus later - Move Grafana dashboards over unchanged if PromQL-compatible
- Gradually reduce Prometheus retention until it is no longer needed
If you want a quick migration checklist
- Identify current Prometheus version and setup
- Choose target TSDB
- Confirm PromQL compatibility
- Set up remote write or new scraping
- Test ingestion with a small metric set
- Migrate rules and dashboards
- Validate queries and alerts
- Cut over gradually
- Decommission old storage after retention window passes
If you tell me which TSDB you’re migrating to (e.g. InfluxDB, VictoriaMetrics, Mimir, Thanos, TimescaleDB), I can give you a much more specific step-by-step migration plan and config examples.