Giter Club home page Giter Club logo

dkrmgr's Introduction

DKRMGR — manager for docker containers

Description

DKRMGR is a go daemon to export docker containers metrics for Prometheus. DKRMGR also includes healing mode — if a container has a healthcheck defined and container health is unhealthy, DKRMGR schedules restart for the container. If the container stays unhealthy after the restart, DKRMGR schedules another restart with a longer delay before the next restart.

DKRMGR is an attempt to combine docker-exporter and docktor in one small tool, and make sure it's simple and robust.

Configuration

DKRMGR is configured with environment variables:

  • DKRMGR_DOCKER_SOCKET
    Path to the docker socket. Default is /var/run/docker.sock

  • DKRMGR_SCRAPE_INTERVAL
    Interval between calls to docker API to get containers state changes. Default is 10s

  • DKRMGR_INSPECT_TIMEOUT
    Timeout for the container inspect API call. Default is 5s

  • DKRMGR_CLEANUP_INTERVAL
    Interval between runs of garbage collector to remove healed/vanished patients from the list. Default is 10s

  • DKRMGR_RESTART_BACKOFF_MIN
    Minimum delay before restarting a container. Default is 5s

  • DKRMGR_RESTART_BACKOFF_MAX
    Maximum delay before restarting a container. Default is 5m. Each consecutive restart (assuming the container stays unhealthy) will be scheduled with a delay of (lastDelay*2), so, with default values this will be 5s, 10s, 20s et caetera. However, when delay reaches maximum (i.e. 5m), it will stay there.

  • DKRMGR_HEAL_MODE
    Turns on healing mode. Default is false.

  • DKRMGR_PORT
    Port on which to start http server to serve metrics. Default is 9102. Metrics will be available at http://localhost:9102/metrics.

  • DKRMGR_DEBUG_MODE
    Turns on debug level logging. Default is false.

Exported metrics

Name Type Labels Remarks
docker_container_count gauge docker_container_count
docker_container_healthy gauge name, image_id 0 if healthy, 1 otherwise
docker_container_restart_count counter name, image_id
docker_container_status gauge name, image_id, docker_container_status
docker_container_stuck_inspect gauge name, image_id 0 if ok, 1 if inspect failed
docker_container_healed counter name, image_id, success, fail

dkrmgr's People

Contributors

alezkv avatar b00men avatar epicfilemcnulty avatar inecheporenko avatar m-khomych avatar viktor-aura avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.