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.
02 Instances
Dynamic configuration allows multiple prometheus instances to be loaded with a parent metric. This uses the same agent-1 and server-1 yml from 01.
docker run -v ${PWD}/:/etc/grafana grafana/agentctl:latest template-parse file:///etc/grafana/02_config.yml
Dynamic Configuration
Tells the Grafana Agent where to load files from.
Metrics
Dynamic Configuration will find the first file matching pattern metrics-*.yml
and load that as the base. You can only have one metrics template.
configs:
- name: default
global:
scrape_interval: 60s
scrape_timeout: 20s
wal_directory: /tmp/grafana-agent-wal
Metrics Instances
You can have any number of metrics_instances and they are added to any existing metrics instances defined previously.
name: instance1
scrape_configs:
- job_name: instance1_job
static_configs:
- targets:
- localhost:4000
name: instance2
scrape_configs:
- job_name: instance2_job
static_configs:
- targets:
- localhost:5555
Final
In the above you will see the final.yml
includes all the instance configurations
- default
- instance1
- instance2