Giter VIP home page Giter VIP logo

docker-service-replicas-exporter's Introduction

docker-service-replicas-exporter

Prometheus metrics exporter for docker service replication counts

Metrics

Metrics will available in http://localhost:9258

$ curl -s localhost:9258
# HELP docker_service_replicas_running Number of replicas running for a service
# TYPE docker_service_replicas_running gauge
docker_service_replicas_running{service_name="service1"} 2.0
docker_service_replicas_running{service_name="service2"} 1.0
# HELP docker_service_replicas_expected Number of replicas expected for a service
# TYPE docker_service_replicas_expected gauge
docker_service_replicas_expected{service_name="service1"} 1.0
docker_service_replicas_expected{service_name="service2"} 1.0

Alert Example

ALERT service_replication_failure
  IF ((docker_service_replicas_running / docker_service_replicas_expected) * 100) < 100
  FOR 5m
  ANNOTATIONS {
      summary = "Service replication failed",
      description = "Service replication is {{$value}}% for {{ $labels.service_name }}",
  }

Config

exporter_port: 9258 # Port on which Prometheus can call this exporter to get metrics
log_level: info

Run

Using code (local)

# Ensure python 2.x and pip installed
pip install -r app/requirements.txt
python app/exporter.py example/config.yml

Using docker

This must be run on a docker swarm master node

docker run -p 9258:9258 -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/example/config.yml:/etc/docker-service-replicas-exporter/config.yml sunbird/docker-service-replicas-exporter /etc/docker-service-replicas-exporter/config.yml

docker-service-replicas-exporter's People

Contributors

endeepak avatar vrayulu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.