Coder Social home page Coder Social logo

davidgiesberg / docker-docker-stats-statsd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edyn/docker-docker-stats-statsd

1.0 3.0 0.0 208 KB

A docker image that collects stats on all running containers and sends them to statsd

License: MIT License

Shell 14.27% JavaScript 85.73%

docker-docker-stats-statsd's Introduction

docker-stats-statsd

Forward all your stats to Etsy's Statsd, like a breeze.

Usage as a Container

The simplest way to forward all your container's log to Statsd. Given the versatility of statsd, you can configure the metrics to go to any supported backends; including Librato, Graphite. All you have to do is run this repository as a container, with:

docker run \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e STATSD_HOST="" \
  -e STATSD_PORT="" \
  -e STATSD_PREFIX="" \
  edyn/docker-stats-statsd

Note that all three options default to reasonable values (STATSD_HOST, STATSD_PORT, STATSD_PREFIX) => (127.0.0.1, 8125, "docker.")


### Running container in a restricted environment.
Some environments(such as Google Compute Engine) does not allow to access the docker socket without special privileges. You will get EACCES(`Error: read EACCES`) error if you try to run the container. To run the container in such environments add --privileged to the `docker run` command.

Example:
```sh
docker run --privileged \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e STATSD_HOST="" \
  -e STATSD_PORT="" \
  -e STATSD_PREFIX="" \
  edyn/docker-stats-statsd

Building a docker repo from this repository

First clone this repository, then:

docker build -t docker-stats .
docker run \
  -v /var/run/docker.sock:/var/run/docker.sock \
  docker-stats

How it works

This module wraps four Docker APIs:

  • POST /containers/{id}/attach, to fetch the logs
  • GET /containers/{id}/stats, to fetch the stats of the container
  • GET /containers/json, to detect the containers that are running when this module starts
  • GET /events, to detect new containers that will start after the module has started

This module wraps docker-loghose and docker-stats to fetch the logs and the stats as a never ending stream of data.

All the originating requests are wrapped in a never-ending-stream.

Credits

This app is based on Meteorhacks.

License

MIT

docker-docker-stats-statsd's People

Contributors

davidgiesberg avatar ecstasy2 avatar looztra avatar m0wfo avatar maxim-filimonov avatar mcollina avatar pelger avatar thani-sh avatar

Stargazers

 avatar

Watchers

 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.