Softbaked's graphite + statsd setup
437
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 \
--restart=always \
-p 80:80 \
-p 2003:2003 \
-p 8125:8125/udp \
softbaked/graphite-statsd
This starts a Docker container named: graphite
That's it, you're done ... almost.
| Host | Container | Service |
|---|---|---|
| 80 | 80 | nginx |
| 2003 | 2003 | carbon |
| 8125 | 8125 | statsd |
| 8126 | 8126 | admin |
| Host | Container | Notes |
|---|---|---|
| DOCKER ASSIGNED | /opt/graphite/storage | graphite stats storage |
Built using Phusion's base image.
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>
Open Graphite in a browser at http://localhost/dashboard.
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/
Read up on Graphite's post-install tasks. Focus on the storage-schemas.conf
docker stop graphite.docker inspect graphite.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 management interface (default on port 8126) allows you to manage statsd and retrieve stats
# show all current counters
echo counters | nc localhost 8126
more info and additional commands: admin_interface
If running this image on cloud infrastructure such as AWS,
you should consider mounting /opt/graphite/storage 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 \
--restart=always \
-v /path/to/ebs/graphite:/opt/graphite/storage \
-p 80:80 \
-p 2003:2003 \
-p 8125:8125/udp \
softbaked/graphite-statsd
Build the image yourself.
git clone https://github.com/softbaked/docker-graphite-statsd.gitcd docker-graphite-statsdvagrant upvagrant sshsudo docker build -t softbaked/graphite-statsd /vagrantNote: Pay attention to the forwarded ports in the Vagrantfile.
git clone https://github.com/softbaked/docker-graphite-statsd.gitsudo docker build -t softbaked/graphite-statsd ./docker-graphite-statsdContent type
Image
Digest
Size
288.5 MB
Last updated
almost 11 years ago
docker pull softbaked/graphite-statsd