Caution
Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Distribute Prometheus metrics scrape load
A good predictor for the size of an Grafana Agent Flow deployment is the number of Prometheus targets each Grafana Agent scrapes. Clustering with target auto-distribution allows a fleet of Grafana Agents to work together to dynamically distribute their scrape load, providing high-availability.
Note: Clustering is a beta feature. Beta features are subject to breaking changes and may be replaced with equivalent functionality that covers the same use case.
Before you begin
- Familiarize yourself with how to configure existing Grafana Agent Flow installations.
- Configure Prometheus metrics collection.
- Configure clustering.
- Ensure that all of your clustered Grafana Agents have the same configuration file.
Steps
To distribute Prometheus metrics scrape load with clustering:
Add the following block to all
prometheus.scrape
components which should use auto-distribution:clustering { enabled = true }
Restart or reload Grafana Agents for them to use the new configuration.
Validate that auto-distribution is functioning:
Using the Grafana Agent UI on each Grafana Agent, navigate to the details page for one of the
prometheus.scrape
components you modified.Compare the Debug Info sections between two different Grafana Agent to ensure that they’re not scraping the same sets of targets.