Skip to content

Instantly share code, notes, and snippets.

@jpemberthy
Last active June 4, 2018 00:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpemberthy/b50d142c391c9d09b32b to your computer and use it in GitHub Desktop.
Save jpemberthy/b50d142c391c9d09b32b to your computer and use it in GitHub Desktop.
StatsD + Graphite on Mavericks

StatsD + Graphite backend on Mavericks.

I highly recommend using virtualenv for this.

Create your env

mkdir statsd
virtualenv env
env/bin/activate

Graphite

Most of these steps are taken from this gist and were adapted to work with virtualenv.

Install Cairo and friends

brew install cairo
brew install py2cairo

Install Django

pip install Django==1.5
pip install django-tagging

Install Graphite

pip install carbon
pip install whisper
pip install graphite-web
pip install Twisted==11.1.0

sudo chown -R `whoami`:staff /opt/graphite

Configure Graphite

cp /opt/graphite/conf/carbon.conf{.example,}
cp /opt/graphite/conf/storage-schemas.conf{.example,}

Create default database

cd /opt/graphite/webapp/graphite

# Modify this file to change database backend (default is sqlite).
cp local_settings.py{.example,}

# Initialize database
python manage.py syncdb

Start Carbon

python /opt/graphite/bin/carbon-cache.py start

Start Graphite

python /opt/graphite/bin/run-graphite-devel-server.py /opt/graphite

Go to:

http://localhost:8080/render

If you see something like ImportError: Could not find Cairo, please follow these instructions to fix it.

Install and start StatsD

brew install node
git clone https://github.com/etsy/statsd.git
cd statsd
cp exampleConfig.js config.js # edit config.js accordingly.
node stats.js config.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment