Skip to content

meteorhacks/docker-librato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-librato

Forward all your stats to Librato Metrics, like a breeze.

Usage as a Container

The simplest way to forward all your container's log to Librato Metrics is to run this repository as a container, with:

docker run \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e LIBRATO_EMAIL="" \
  -e LIBRATO_TOKEN="" \
  meteorhacks/docker-librato

You can also use two different tokens for logging and stats:

docker run \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e LIBRATO_EMAIL="" \
  -e LIBRATO_TOKEN="" \
  meteorhacks/docker-librato

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:

docker run --privileged \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e LIBRATO_EMAIL="" \
  -e LIBRATO_TOKEN="" \
  meteorhacks/docker-librato

Building a docker repo from this repository

First clone this repository, then:

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

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 nearform/docker-logentries.

License

MIT

About

Forward all stats from all running docker containers to Librato

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages