🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## 安装 ### docker <details> <summary>~/docker/prometheus/prometheus.yml</summary> ``` # 全局设置 global: scrape_interval: 15s # 设置抓取时间间隔为每15秒一次。默认为每1分钟一次。 evaluation_interval: 15s # 表示每15检测一次告警规则。 默认值为每1分钟。 # scrape_timeout is set to the global default (10s). # 监控管理配置 alerting: alertmanagers: - scheme: http static_configs: - targets: # - "yourip:9093" # 加载规则 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: # - "first_rules.yml" # - "second_rules.yml" # - "rules/*.yml" # 这里定义了 Prometheus 要抓取的目标 scrape_configs: # Prometheus 在启动的时候也会通过 HTTP 接口暴露自身的指标数据,这就相当于 Prometheus 自己监控自己 - job_name: 'prometheus' # 通过 http://localhost:9090/metrics 查看普罗米修斯暴露哪些指标 static_configs: - targets: ['localhost:9090'] ``` </details> <br/> 启动 ``` > sudo docker run -d -p 9090:9090 \ -v ~/docker/prometheus/:/etc/prometheus/ \ prom/prometheus ```