- Vertical scaling (team- or service-based isolation)
- Horizontal scaling (sharding a scrape job across multiple Prometheus servers)
- Federation and aggregation for a global view
- Alternatives (Thanos, Cortex) for unified querying and long-term storage
Vertical scaling
Vertical scaling assigns ownership: each Prometheus instance monitors a distinct set of services or applications. This limits time series cardinality per instance and lets teams manage their own alerting and recording rules independently.
- Clear ownership and accountability for metric cardinality and configuration.
- Teams can experiment with alerting and dashboards without impacting others.
- Limits blast radius when a single Prometheus instance misbehaves.
Horizontal scaling (sharding)
Horizontal sharding splits a large scrape job across multiple Prometheus servers. This is ideal when one job has many instances and a single Prometheus cannot scrape them all in time.
- Configure the full target list on every Prometheus server.
- Use
relabel_configswithhashmodto deterministically keep a portion of targets on each server.
0):
1):
- Set
modulusequal to the number of shards (e.g.,modulus: 5for five servers, matching regex0through4across servers). - Keep the same full target list on all servers; relabeling determines which server retains each target.
- Distribution is deterministic but not guaranteed perfectly even — monitor and rebalance if necessary.
Other tuning options for a single server
If you want to avoid multiple Prometheus instances, tune a single server to reduce load.- Increase scrape intervals for slow-changing metrics:
- Limit samples per scrape to prevent a single target from producing too many time series:
Federation: global view without copying everything
Federation is commonly used to aggregate metrics from multiple Prometheus servers (for example, one per datacenter). A global Prometheus can scrape the/federate endpoint of per-datacenter Prometheus servers to provide a single-pane-of-glass view.

job="node"):
- Use
metrics_path: "/federate"to scrape another Prometheus’ federate endpoint. params.match[]controls which series the federated endpoint returns.honor_labels: truepreserves labels from the source Prometheus.
Aggregate and record rules before federating
A best practice is to calculate aggregated series (via recording rules) on each per-datacenter Prometheus, then federate only those aggregated metrics to the global server. Recording rules example (on each datacenter Prometheus):Avoid duplicate series — label your data sources
If multiple datacenter Prometheus servers expose identical metric names and labels, the global Prometheus will see them as duplicate series. Make series unique by adding adatacenter label.
Add a relabeling step on the global Prometheus or on the per-datacenter Prometheus:
- On the other datacenter, set
replacement: dc2.
datacenter so you can query metrics per datacenter:
Do not use federation to copy entire Prometheus instances or to proxy queries. Federation is intended for pulling specific aggregated metrics, not for duplicating instance-level series or acting as a proxy for full query traffic.
Federation summary

Alternatives: Thanos and global querying
If you want a unified query layer and long-term storage without restricting to aggregated metrics, consider solutions such as Thanos or Cortex:- Thanos (https://thanos.io/) — attaches sidecars to Prometheus instances and provides global query, downsampling, and object-store-backed long-term storage.
- Cortex (https://cortexmetrics.io/) — scalable, multi-tenant Prometheus-compatible system offering a global view with long-term storage.

Comparison at a glance
Further reading and references
- Prometheus documentation: https://prometheus.io/docs/
- Thanos: https://thanos.io/
- Cortex: https://cortexmetrics.io/
- Prometheus relabeling: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
Summary
- Use vertical scaling to grant teams isolated Prometheus instances and ownership.
- Use horizontal sharding to split large scrape jobs across multiple Prometheus servers.
- Tune scrape intervals and
sample_limitfor single-server protection. - Use federation only for carefully selected aggregated metrics, and add labels (e.g.,
datacenter) to avoid duplicates. - For unified, instance-level querying and long-term storage consider Thanos or Cortex instead of copying instance-level series via federation.
Tip: Monitor Prometheus runtime metrics (e.g.,
prometheus_tsdb_head_series, prometheus_engine_query_duration_seconds) to detect cardinality or query-load issues early and choose the appropriate scaling strategy.