I wanted to view my Fastly stats inside of my Datadog dashboard - here's how it's done:
- Fastly CDN account at the "Faster" level.
- A DatadogHQ account.
- An Ubuntu 10.0.4LTS server with Syslog TCP port open.
- Datadog software higher than 3.0.x installed on that machine.
- If you use Chef - there's a cookbook that can help.
- You need to tell Fastly where to push the logfiles. - you may also be able to do this from the Fastly admin interface.
- Deploy your updated VCL files - from within the Fastly admin interface.
- On the Ubuntu box:
apt-get install libcurl4-openssl-dev
- On the Ubuntu box:
gem install fastly dogstatsd-ruby statsd dogapi eventmachine eventmachine-tail
- Wait for the logs to show up - it was pretty quick for me.
- Pick a log where the data's appearing - I used /var/log/user.log.
- Run the fastdog.rb script like this:
ruby fastdog.rb /var/log/user.log
- In the Datadog admin interface - create a new graph like this.
- Profit.
- Count hits for specific sites as required.
- Add bytes graph. For specific sites as required.
- Daemonize fastdog.rb - right now it's running in screen - sue me.