Coder Social home page Coder Social logo

adriantofan / docker-diamond Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nihn/docker-diamond

0.0 1.0 0.0 8 KB

Minimal image for Diamond daemon.

Home Page: https://hub.docker.com/r/mateuszm/diamond/

License: MIT License

Python 100.00%

docker-diamond's Introduction

docker-diamond

Minimal image based on python:2.7.12-alpine with Diamond daemon running. It is designed to collect metric from other containers over network.

Base usage

docker run --rm -e STATSD_HOST=some.statsd.net mateuszm/docker

Configuration

Base config is done via environment variables:

HANDLERS               Diamond handlers to use, defaults to diamond.handler.stats_d.StatsdHandler.
GRAPHITE_HOST          address of your graphite instance, defaults to 127.0.0.1.
GRAPHITE_PORT          port on which your graphite listens on, default to 2003.
STATSD_HOST            address of your StatsD daemon, defaults to 127.0.0.1.
STATSD_PORT            port on which StatsD listens on, default to 8125.
INTERVAL               the interval at which you wish to send metrics, defaults to 10.
PATH_PREFIX            prefix to all metrics processed by Diamond, defaults to ''
DIAMOND_CONF           path to diamond config, defaults to /etc/diamond/diamond.conf.
COLLECTORS_CONF_DIR    path to diamond collectors config dir, defaults to /etc/diamond/collectors.
COLLECTORS_DIR         path to additional diamond collectors, defaults to /use/local/share/diamond/collectors.
HANDLERS_CONF_DIR      path to diamond handlers config dir, defaults to /etc/diamond/handlers.
HANDLERS_DIR         path to additional diamond handlers, defaults to /use/local/share/diamond/handlers.

For more sophisticated cases you can copy your own diamond config:

COPY diamond.conf $DIAMOND_CONF

Config files (diamond.conf and everything in $COLLECTORS_CONF_DIR and HANDLERS_CONF_DIR) is formated by image's entrypoint with environment as keys, so you can dynamically change it's contents by using environment variables in braces, e.g:

[server]

# Handlers for published metrics.
handlers = {HANDLERS}

For enabling collectors just copy their configuration files:

COPY CPUCollector.conf $COLLECTORS_CONF_DIR

Same applies to additional collectors/handlers as .py files.

COPY <myrabbitcollector>.py $COLLECTORS_DIR/rabbitmq/
COPY fancy.py $COLLECTORS_DIR/fancy/

If you want use environment variables in your custom configuration files due to limitations in COPY directive which does not respect USER directive, you must use following pattern.

COPY collecetorConfigYouWantToBeFormated.conf $COLLECTORS_CONF_DIR
...
USER root
RUN chown -R diamond $COLLECTORS_CONF_DIR
USER diamond

or simply run diamond as a root user.

docker-diamond's People

Contributors

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