Git Product home page Git Product logo

docker_state_exporter's Introduction

Docker State Exporter

Exporter for docker container state

Prometheus exporter for docker container state, written in Go.

One of the best known exporters of docker container information is cAdvisor.
However, cAdvisor does not export the state of the container.

This exporter will only export the container status and the restarts count.

Installation and Usage

The docker_state_exporter listens on HTTP port 8080 by default.

Docker

For Docker run.

sudo docker run -d \
  -v "/var/run/docker.sock:/var/run/docker.sock" \
  -p 8080:8080 \
  $REPO/docker_state_exporter \
  --web.listen-address=:8080

For Docker compose.

---
version: '3.8'

services:
  docker_state_exporter:
    image: $REPO/docker_state_exporter
    volumes:
      - type: bind
        source: /var/run/docker.sock
        target: /var/run/docker.sock
    ports:
      - "8080:8080"

Metrics

This exporter will export the following metrics.

  • container_state_health_status
  • container_state_status
  • container_state_oomkilled
  • container_state_startedat
  • container_state_finishedat
  • container_restartcount

These metrics will be the same as the results of docker inspect.

This exporter also exports the standard Go Collector and Process Collector.

Performance

The polling of docker inspect commands is set to every one second.

TODO: Include container last seen metric - should still show even if container does not exist anymore

Build the go binary and container

git clone https://github.com/AdaptiveConsulting/docker_state_exporter
cd docker_state_exporter
docker build . -t docker_state_exporter_test

Run

sudo docker run -d \
  -v "/var/run/docker.sock:/var/run/docker.sock" \
  -p 8080:8080 \
  docker_state_exporter_test \
  --web.listen-address=:8080

docker_state_exporter's People

Contributors

joan-s-molas avatar lexvar avatar karugaru avatar niu789 avatar sergei-ivanov 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.