参考
https://www.cnblogs.com/xiangsikai/p/11288801.html
https://www.cnblogs.com/xiaobaozi-95/p/10639076.html
配置
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:9090']
- job_name: 'mysql'
- targets: ['localhost:3306']
热加载配置
# 修改 prometheus.yml 后可通过 reload 接口刷新配置
# 注意用 POST
curl -X POST http://localhost:9090/-/reload
实现prometheus exporter
https://www.jianshu.com/p/5db23a280e1d
prometheus label
https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels,-not-static-scraped-labels
https://prometheus.io/docs/practices/instrumentation/#things-to-watch-out-for