Coder Social home page Coder Social logo

jcsaaddupuy / docker-graphite-statsd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hopsoft/docker-graphite-statsd

0.0 2.0 0.0 347 KB

Docker image for Graphite & Statsd

License: MIT License

ApacheConf 69.85% Python 23.82% Nginx 4.29% JavaScript 0.27% Shell 1.77%

docker-graphite-statsd's Introduction

Gratipay

Docker Image for Graphite & Statsd

Get Graphite & Statsd running instantly

Graphite & Statsd can be complex to setup. This image will have you running & collecting stats in just a few minutes.

Quick Start

sudo docker run -d \
  --name graphite \
  -p 80:80 \
  -p 2003:2003 \
  -p 8125:8125/udp \
  hopsoft/graphite-statsd

This starts a Docker container named: graphite

That's it, you're done ... almost.

Includes the following components

  • Nginx - reverse proxies the graphite dashboard
  • Graphite - front-end dashboard
  • Carbon - back-end
  • Statsd - UDP based back-end proxy

Mapped Ports

Host Container Service
80 80 nginx
2003 2003 carbon
8125 8125 statsd

Mounted Volumes

Host Container Notes
DOCKER ASSIGNED /opt/graphite graphite config & stats storage
DOCKER ASSIGNED /etc/nginx nginx config
DOCKER ASSIGNED /opt/statsd statsd config
DOCKER ASSIGNED /etc/logrotate.d logrotate config
DOCKER ASSIGNED /var/log log files

Base Image

Built using Phusion's base image.

  • All Graphite related processes are run as daemons & monitored with runit.
  • Includes additional services such as logrotate.

Start Using Graphite & Statsd

Send Some Stats

Let's fake some stats with a random counter to prove things are working.

while true
do
  echo -n "example.statsd.counter.changed:$(((RANDOM % 10) + 1))|c" | nc -w 1 -u localhost 8125
done
<CTL-C>

Visualize the Data

Open Graphite in a browser at http://localhost/dashboard.

Secure the Django Admin

Update the default Django admin user account. The default is insecure.

First login at: http://localhost/account/login Then update the root user's profile at: http://localhost/admin/auth/user/1/

Change the Configuration

Read up on Graphite's post-install tasks. Focus on the storage-schemas.conf

  1. Stop the container docker stop graphite.
  2. Find the configuration files on the host by inspecting the container docker inspect graphite.
  3. Update the desired config files.
  4. Restart the container docker start graphite.

Note: If you change settings in /opt/graphite/conf/storage-schemas.conf be sure to delete the old whisper files under /opt/graphite/storage/whisper/.


Important: Ensure your Statsd flush interval is at least as long as the highest-resolution retention. For example, if /opt/statsd/config.js looks like this.

flushInterval: 10000

Ensure that storage-schemas.conf retentions are no finer grained than 10 seconds.

[all]
pattern = .*
retentions = 5s:12h # WRONG
retentions = 10s:12h # OK
retentions = 60s:12h # OK

A Note on Disk Space

If running this image on cloud infrastructure such as AWS, you should consider mounting /opt/graphite & /var/log on a larger volume.

  1. Configure the host to mount a large EBS volume.

  2. Specify the volume mounts when starting the container.

    sudo docker run -d \
      --name graphite \
      -v /path/to/ebs/graphite:/opt/graphite \
      -v /path/to/ebs/log:/var/log \
      -p 80:80 \
      -p 2003:2003 \
      -p 8125:8125/udp \
      hopsoft/graphite-statsd
    

Additional Reading

Contributors

Build the image yourself.

OSX

  1. git clone https://github.com/hopsoft/docker-graphite-statsd.git
  2. cd docker-graphite-statsd
  3. vagrant up
  4. vagrant ssh
  5. sudo docker build -t hopsoft/graphite-statsd /vagrant

Note: Pay attention to the forwarded ports in the Vagrantfile.

Linux

  1. git clone https://github.com/hopsoft/docker-graphite-statsd.git
  2. sudo docker build -t hopsoft/graphite-statsd ./docker-graphite-statsd

docker-graphite-statsd's People

Contributors

bonyiii avatar coderfi avatar hopsoft avatar odolbeau avatar samos123 avatar tomislacker avatar

Watchers

 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.