Skip to content

neuroforgede/docker-service-dns-prometheus-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-service-dns-prometheus-exporter

Monitor your Docker Swarm for DNS resolution errors and export it to Prometheus. Currently only supports VIP based routing DNS checks.

Use in a Docker Swarm deployment

Deploy:

version: "3.8"

services:
  docker_socket_proxy:
    image: tecnativa/docker-socket-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - net
    environment:
      CONTAINERS: 1
      SERVICES: 1
      SWARM: 1
      NODES: 1
      NETWORKS: 1
      TASKS: 1
      VERSION: 1

      AUTH: 1
      SECRETS: 1
      POST: 1
      BUILD: 1
      COMMIT: 1
      CONFIGS: 1
      DISTRIBUTION: 1
      EXEC: 1
      GRPC: 1
      IMAGES: 1
      INFO: 1
      PLUGINS: 1
      SESSION: 1
      SYSTEM: 1
      VOLUMES: 1
    deploy:
      mode: global

  docker-service-dns-prometheus-exporter:
    image: ghcr.io/neuroforgede/docker-service-dns-prometheus-exporter/dnscheck:latest
    environment:
      - PROXY_SERVICE_NAME=monitoring_docker_socket_proxy
      - DNS_CHECK_CONTAINER_IMAGE=ghcr.io/neuroforgede/docker-service-dns-prometheus-exporter/dnscheck:latest
      - DEBUG=true
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
    networks:
      - net
    deploy:
      mode: replicated
      replicas: 1
      resources:
        limits:
          memory: 256M
        reservations:
          memory: 128M
      placement:
        constraints:
          - node.role==manager

prometheus.yml

# ...
scrape_configs:
  - job_name: 'docker-service-dns-prometheus-exporter'
    dns_sd_configs:
    - names:
      - 'tasks.docker-service-dns-prometheus-exporter'
      type: 'A'
      port: 9000