prometheus-agent
2025年12月9日小于 1 分钟
用来接收指标
- server 启动需要指定 --web.enable-remote-write-receiver
./prometheus --config.file prometheus.yml --web.enable-remote-write-receiver- agent 启动
./prometheus --web.listen-address=:9091 --agent --config.file=prometheus-agent.yml
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["localhost:9091"]
# The label name is added as a label `label_name=<label_value>` to any timeseries scraped from this config.
labels:
app: "prometheus"
remote_write:
- url: "http://localhost:9090/api/v1/write"