Skip to content

Instantly share code, notes, and snippets.

@vspedr
Last active January 30, 2018 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vspedr/ed4c07fd9960ce1719b3777558e34cfc to your computer and use it in GitHub Desktop.
Save vspedr/ed4c07fd9960ce1719b3777558e34cfc to your computer and use it in GitHub Desktop.
Grafana + Graphite + statsd + docker getting started

This provides a minimal setup for running grafana, graphite and statsd in docker containers for experimenting. Not suitable for production environment as additional security configuration is required.

Assuming you have docker installed and ready for use:

  1. Run official grafana image:
docker run -d -p 3000:3000 grafana/grafana
  1. Run hopsoft/docker-graphite-statsd image:
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\
 hopsoft/graphite-statsd
  1. Enter grafana admin console at localhost:3000. Default user/pass is admin@localhost/admin

  2. Click "Create your first data source". Give it a name such as "GraphiteDS" and under HTTP Settings set the URL to "http://localhost:80" and Access to "direct". Click Add, then you should see the message "Data source is working".

Optional steps

  1. To generate some random stats, open a separate terminal and run
while true; do echo -n "example:$((RANDOM % 100))|c" | nc -w 1 -u 127.0.0.1 8125; done
  1. Go back to Grafana Home Dashboard (localhost:3000) and click "Create your first dashboard";

  2. Add a new Graph panel and edit it. Under the Metrics tab, set the data source to GraphiteDS (or the name you chose);

  3. in the "A" row, click "select metrics" then "stats". Now click "select metrics" to the right then click "example" (this name comes from step 5);

  4. Done! If you followed the steps correctly you should see some sample data in the panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment