Graphite and Statsd with integrated counters for VMware ESXi
691
This was based from an existing project created by Nathan Hopkins. Please find his work here: https://github.com/hopsoft/docker-graphite-statsd
GitHub: https://github.com/danjellesma/docker-graphite-statsd-esxi
The ESXi metrics configuration was added from this project: https://github.com/syepes/VSphere2Metrics/wiki/Graphitepr
Graphite & Statsd can be complex to setup. This image will have you running & collecting stats in just a few minutes.
docker run -d --name graphite --restart=always danjellz/graphite-statsd-esxi
This starts a Docker container named: graphite
That's it, you're done ... almost.
| Host | Container | Service |
|---|---|---|
| 80 | 80 | nginx |
| 2003 | 2003 | carbon |
| 2004 | 2004 | carbon aggregator |
| 2023 | 2023 | carbon pickle |
| 2024 | 2024 | carbon aggregator pickle |
| 8125 | 8125 | statsd |
| 8126 | 8126 | statsd admin |
Note: You can override the default port mappings by specifying them when starting the container.
docker run -d\
--name graphite\
--restart=always\
-p 80:80\
-p 2003-2004:2003-2004\
-p 2023-2024:2023-2024\
-p 8125:8125/udp\
-p 8126:8126\
danjellz/graphite-statsd-esxi
| Host | Container | Notes |
|---|---|---|
| DOCKER ASSIGNED | /opt/graphite/conf | graphite config |
| DOCKER ASSIGNED | /opt/graphite/storage | graphite 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.
Let's fake some stats with a random counter to prove things are working.
while true; do echo -n "example:$((RANDOM % 100))|c" | nc -w 1 -u localhost 8125; done
Open Graphite in a browser.
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 & retrieve stats.
# show all current counters
echo counters | nc localhost 8126
More info & additional commands.
You may find it useful to mount explicit volumes so configs & data can be managed from a known location on the host.
Simply specify the desired volumes when starting the container.
docker run -d\
--name graphite\
--restart=always\
-v /path/to/graphite/configs:/opt/graphite/conf\
-v /path/to/graphite/data:/opt/graphite/storage\
-v /path/to/statsd:/opt/statsd\
danjellz/graphite-statsd-esxi
Note: The container will initialize properly if you mount empty volumes at
/opt/graphite, /opt/graphite/conf, /opt/graphite/storage, or /opt/statsd
Build the image yourself.
git clone https://github.com/danjellesma/docker-graphite-statsd-esxi.gitdocker build -t danjellz/graphite-statsd-esxi .Content type
Image
Digest
Size
302.7 MB
Last updated
over 10 years ago
docker pull danjellz/graphite-statsd-esxi