Skip to content

devsisters/docker-graphite-statsd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Image for Graphite

Deploy Graphite & Statsd with a single click... almost

Graphite & Statsd can be a pain in the ass to setup. This Docker image will help you get up & running quickly.

Quick Start

git clone https://github.com/hopsoft/docker-graphite-statsd.git
./docker-graphite-statsd/bin/start

This starts a Docker container named: graphite

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

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

Mounted Volumes

Host Container
/var/log/graphite /var/log
DOCKER ASSIGNED /opt/graphite/storage
DOCKER ASSIGNED /opt/graphite/conf

Build

  1. Install Boot2Docker (with Docker)
  2. Run ./bin/build
  3. Done!

Run

  1. Check if Boot2Docker is running.
  2. Run ./bin/start
  3. Done!

Deploy

  1. Push built image to docker registry
docker push docker.devscake.com/graphite-statsd
  1. Go to graphite server, run chef-client
  • Be aware that statsd will temporarily turned off, you MUST ask others to check the status

Start Using Graphite & Statsd

Send Some Stats

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

./docker-graphite-statsd/bin/send_stats

Visualize the Data

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

Update the Configuration

  1. 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/

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

Note: If you change settings in storage-schemas.conf, be sure to run whisper-resize.py to resize the whisper files. For example, if you update the config to look something like this:

[all]
pattern = .*
retentions = 10s:12h,1m:7d,10m:5y

Resize the storage files by running the following.

docker attach graphite
find /opt/graphite/storage -type f -name '*.wsp' \
-exec whisper-resize.py --nobackup {} 10s:12h 1m:7d 10m:5y \;
<CTL-P><CTL-Q> # detaches from the container

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

Read more about synching Statsd with Graphite configs.

  1. Learn about Statsd.

  2. Start sending stats from your apps.

Useful Docker Commands

docker attach graphite # attaches to the running container
<CTL-P><CTL-Q>         # detaches from the container

docker stop graphite   # stops the container

docker start graphite  # starts the container (after it's been stopped)

docker rm graphite     # removes the container

Additional Reading

About

Docker image for Graphite & Statsd

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%