通过Docker Compose在单机上面部署prometheus+grafana+pushgateway+alertmanager;里面覆盖邮件告警模板、微信告警模板等
# cat prometheus/prometheus.yaml
scrape_configs:
- job_name: "prometheus-gather"
static_configs:
- targets:
- 192.168.3.97:9090
- 192.168.3.97:9091
- 192.168.3.97:3000
#说明:
9090:prometheus
9090:pushgateway
3000:grafana
bash ./init.sh
启动
docker-compose up -d
停止
docker-compose down
Prometheus: http://localhost:9090
Grafana: http://localhost:3000 \(User\: admin / Password\: admin@123\)
Pushgateway: http://localhost:9091
Alertmanager: http://localhost:9093
echo "some_metric 3.14" | curl --data-binary @- http://localhost:9091/metrics/job/some_job
#登陆pushgateway进行查看会有一条数据 job="some_job"