本篇主要记录Prometheus+Pushgateway的方式监控Flink任务
一 准备工作
1. 下载Prometheus、Pushgateway和AlertManager
下载地址:https://prometheus.io/download/
二 配置
1. 将下载的组件解压到任意目录,如
/app/prometheus
/app/pushgateway
/app/alertmanager
2. 配置prometheus
# 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).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "rules/*.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
s