Docker Image for Graphite, Collectd & Statsd
Derived from https://github.com/hopsoft/docker-graphite-statsd (https://registry.hub.docker.com/u/hopsoft/graphite-statsd/) and extended by collectd like here: https://github.com/joemiller/collectd-graphite
Get Graphite, Collectd & Statsd running instantly
Graphite & Statsd can be complex to setup.
This image will have you running & collecting stats in just a few minutes.
sudo docker run -d \ --name graphite \ -p 80:80 \ -p 2003:2003 \ -p 8125:8125/udp \ -p 25836:25826/udp \ springerplatformengineering/graphite-collectd-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
- Collectd - Server
- Statsd - UDP based back-end proxy
|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|
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>
Now let's send something to collectd (requires collectd installed on host):
collectd-tg -H 1000 -n 100000 -d localhost
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.
- username: root
- password: root
- email: firstname.lastname@example.org
Change the Configuration
- Stop the container
docker stop graphite.
- Find the configuration files on the host by inspecting the container
docker inspect graphite.
- Update the desired config files.
- Restart the container
docker start graphite.
Note: If you change settings in
be sure to delete the old whisper files under
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.
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
/var/log on a larger volume.
- Configure the host to mount a large EBS volume.
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 \ springerplatformengineering/graphite-collectd-statsd