All Projects → vegasbrianc → Docker Traefik Prometheus

vegasbrianc / Docker Traefik Prometheus

A Docker Swarm Stack for monitoring Traefik with Promethues and Grafana

Projects that are alternatives of or similar to Docker Traefik Prometheus

Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-50.23%)
Mutual labels:  monitoring, metrics, prometheus, grafana, docker-compose
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-48.84%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+21262.79%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (+35.81%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Prometheus
A docker-compose stack for Prometheus monitoring
Stars: ✭ 3,383 (+1473.49%)
Mutual labels:  prometheus, grafana, docker-compose, docker-swarm
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+823.72%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+160%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Github Monitoring
Monitor your GitHub Repos with Docker & Prometheus
Stars: ✭ 163 (-24.19%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Prometheus
Kubernetes Setup for Prometheus and Grafana
Stars: ✭ 824 (+283.26%)
Mutual labels:  monitoring, metrics, prometheus, grafana
Giropops Monitoring
Full stack tools for monitoring containers and other stuff. ;)
Stars: ✭ 1,019 (+373.95%)
Mutual labels:  monitoring, prometheus, grafana, docker-swarm
Swarmstack
A Docker swarm-based starting point for operating highly-available containerized applications.
Stars: ✭ 181 (-15.81%)
Mutual labels:  prometheus, grafana, swarm, docker-swarm
Icingaweb2 Module Grafana
Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
Stars: ✭ 190 (-11.63%)
Mutual labels:  monitoring, metrics, grafana
Docker Prometheus Swarm
Sample prometheus that can be used as a sample to get Swarm cluster metrics
Stars: ✭ 210 (-2.33%)
Mutual labels:  prometheus, grafana, docker-swarm
Prometheus
The Prometheus monitoring system and time series database.
Stars: ✭ 40,114 (+18557.67%)
Mutual labels:  monitoring, metrics, prometheus
Rabbitmq Prometheus
A minimalistic Prometheus exporter of core RabbitMQ metrics
Stars: ✭ 124 (-42.33%)
Mutual labels:  monitoring, metrics, prometheus
Bigquery Grafana
Google BigQuery Datasource Plugin for Grafana.
Stars: ✭ 188 (-12.56%)
Mutual labels:  monitoring, metrics, grafana
Stagemonitor
an open source solution to application performance monitoring for java server applications
Stars: ✭ 1,664 (+673.95%)
Mutual labels:  monitoring, metrics, grafana
Swarmprom
Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager
Stars: ✭ 1,739 (+708.84%)
Mutual labels:  prometheus, grafana, swarm
Grafana Influx Dashboard
Grafana InfluxDB scripted dashboard
Stars: ✭ 130 (-39.53%)
Mutual labels:  monitoring, metrics, grafana
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-10.23%)
Mutual labels:  monitoring, metrics, grafana

Monitor Traefik with Prometheus

This Repo helps you get started with monitoring Traefik v2.0the amazing Reverse Proxy + so much more. Along with Traefik we will provision Prometheus for Time Series Data collection and Grafana for Visualization. Traefik will also act as a proxy in front of Promethues and Grafana while Prometheus monitors Traefik the other way. Cool, huh?

Before we can begin ensure you have Docker installed with Docker Swarm enabled. If you are using Docker for Desktop Mac or Windows you already have Swarm enabled. For all others please follow the Swarm setup guide.

The presentation and Video from this demo is also included in the Repo - 56k_Cloud_Traefik_Monitoring.pdf and Youtube Session

Traefik Diagram

Goals of the Traefik Monitoring Repo:

  • Provision a Traefik Stack with Prometheus metrics enabled
  • Deploy Prometheus & Grafana
  • Verify Traefik Metrics
  • Configure Dashboards in Grafana for Traefik

Review the Traefik Monitoring Stack Deployment

In this section we will prepare and deploy our Traefik Reverse Proxy and our monitoring stack.

First, we need to clone this Repo to your Docker Swarm. Ensure you are performing this on your Manager node. If you only have one node then this is also the manager.

git clone https://github.com/vegasbrianc/docker-traefik-prometheus.git

Next, lets review what the stack is doing before we deploy it. With your favorite editor (vim of course). Open the docker-compose.yml file.

cd docker-traefik-prometheus
vi docker-compose.yml

The Traefik metrics are enabled by the command we pass to the Traefik container. The --metrics flag enables metrics and --metrics.prometheus.buckets=0.1,0.3,1.2,5.0 defines the Prometheus bucket value (typically in seconds). Prometheus monitors for all values and stores the metric in the appropriate bucket.

version: '3.7'

services:
traefik:
    image: traefik:v2.0
    command:
    - "--logLevel=DEBUG"
    - "--api"
    - "--metrics"
    - "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
    - "--docker"
    - "--docker.swarmMode"
    - "--docker.domain=docker.localhost"
    - "--docker.watch"

Grafana and Prometheus are being deployed by Docker Swarm and the networking is managed by Traefik. We use labels for the services deployed to inform Traefik how to setup the frontend and backend for each service.

Grafana Deployment

deploy:
 labels:
  - "traefik.port=3000"
  - "traefik.docker.network=inbound"
  -  "traefik.frontend.rule=Host:grafana.localhost"

Prometheus Deployment

deploy:
  labels:
   - "traefik.frontend.rule=Host:prometheus.localhost"
   - "traefik.port=9090"
   - "traefik.docker.network=inbound"

Prometheus is also configured to monitor Traefik. This is configured in Prometheus.yml which enables Prometheus to auto-discover Traefik inside of Docker Swarm. Prometheus is watching for the Service Task tasks.traefik on port 8080. Once the service is online metrics will begin flowing to Prometheus.

Deploy Traefik, Prometheus, and Grafana

OK, we now know where everything is configured inside of the stack. The moment of truth DEPLOY

In the docker-traefik-prometheusdirectory run the following:

docker stack deploy -c docker-compose.yml traefik

Verify all the services have been provisioned. The Replica count for each service should be 1/1 Note this can take a couple minutes

docker service ls

Check the Metrics

Once all the services are up we can open the Traefik Dashboard. The dashboard should show us our frontend and backends configured for both Grafana and Prometheus.

http://docker.localhost:8080/

Take a look at the metrics which Traefik is now producing in Prometheus metrics format

http://localhost:8080/metrics

Login to Grafana and Visualize Metrics

Grafana is an Open Source visualization tool for the metrics collected with Prometheus. Next, open Grafana to view the Traefik Dashboards. Note: Firefox doesn't properly work with the below URLS please use Chrome

http://grafana.localhost

Username: admin Password: foobar

Open the Traefik Dashboard and select the different backends available

Note: Upper right-hand corner of Grafana switch the default 1 hour time range down to 5 minutes. Refresh a couple times and you should see data start flowing

Deploy a new webservice

Of course we couldn't do a demo without showing some Cat Gifs. This demo launches a random cat picture of the day served by three instances of the Cats Services.

docker stack deploy -c cats.yml cats

Let's have a look at our new service

http://cats.localhost

Refresh a few times and notice the Traefik Proxy is loadbalancing our requests to the 3 different Cat services.

Now, head back to Grafana. Refresh the Traefik dashboard in the upper right corner and set 5 minutes for our time range. Select, the Cats backend in the Dashboard.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].