sitespeedio/gatographite
Fetch metrics from Google Analytics and send to Graphite
773
Container for fetching metrics from Google Analytics and send them to Graphite. This is perfect if you want to correlate your metrics from sitespeed.io with page views or even RUM data. Massive love to https://github.com/etsy/GoogleAnalyticsToGraphite for inspiration.
Google API version 3 is used and it is some work to get the auth and setup to work:
docker run --rm -v /path/to/my.pem:/home/root/my.pem -v /path/to/env.sh:/home/root/scripts/env.sh sitespeedio/gatographite gatographite
You can either feed the script with params or add your values to the env.sh file. Easiest using Docker is just to configure env.sh.
Metrics that you can fetch is the one in the Google Analytics API: https://developers.google.com/analytics/devguides/reporting/core/dimsmets
You choose that by giving a comma separated list to metrics like this:
export GA_METRICS=ga:pageviews,ga:sessions,ga:avgTimeOnSite,ga:domContentLoadedTime
docker run --rm -v /path/to/my.pem:/home/root/my.pem -v "/path/to/env.sh:/home/root/scripts/env.sh sitespeedio/gatographite gatographite
docker run --rm -v /path/to/my.pem:/home/root/my.pem -v /path/to/env.sh:/home/root/scripts/env.sh sitespeedio/gatographite gatographite 3
docker run --rm -v /path/to/my.pem:/home/root/my.pem -v /path/to/env.sh:/home/root/scripts/env.sh sitespeedio/gatographite gatographite 2015-06-01
Do you get an error like Error: invalid_grant? It's because the clock in Docker is not synced between your container and your Mac. Easiest solution is to stop and start boot2docker (the clock is then in sync) and run again.
docker pull sitespeedio/gatographite