项目作者: saidsef

项目描述 :
Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager
高级语言: Shell
项目地址: git://github.com/saidsef/prom-docker-swarm.git
创建时间: 2018-06-04T14:05:47Z
项目社区:https://github.com/saidsef/prom-docker-swarm

开源协议:MIT License

下载


Prom-Docker-Swarm

This is a starter kit for Docker Swarm Monitoring.

In order to collect metrics from Swarm nodes you need to deploy the exporters on each server. Using global services you don’t have to manually deploy the exporters.

When you scale up your cluster, Swarm will launch a cAdvisor and node-exporter instances on the newly created nodes.

Prerequisites

  • Docker Engine >= 17.x
  • Swarm Cluster

Tech Stack

  • Grafana
  • Prometheus
  • cAdvisor
  • AlertManager
  • Node Exporter
  • Blackbox Exporter

Swarm Prometheus Configuration

To configure the Docker daemon as a Prometheus target, you need to specify the metrics-address. The best way to do this is via the daemon.json, which is located at one of the following locations by default. If the file does not exist, create it.

Configuration file location

  1. /etc/docker/daemon.json
  1. {
  2. "metrics-addr" : "127.0.0.1:4999",
  3. "experimental" : true
  4. }

Deployment

You can use the provided docker-compose.yml file as an example. You can deploy the full stack with the command.

  1. docker swarm init
  2. docker stack deploy -c docker-compose.yml monitoring

Services Access

  • Grafana http://<swarm-address>:3000/ (admin:admin)
  • Prometheus http://<swarm-address>:9090/
  • AlertManager http://<swarm-address>:9093/

Grafana Dashboard Panels

  • HTTP Duration (s)
  • HTTP Duration Phase (s)
  • HTTP Status Code
  • Websites Uptime (%)
  • Containers Memory Usage (top 3)
  • Disk Usage Prediction (%)
  • Websites SSL Expiry (Days)
  • Websites Request Rates (s)
  • Websites DNS Lookup (s)
  • Websites Total
  • Websites Down

Screenshots

Dashboard
HTTDuration
Website
Container
DNS
SSL