Customised from https://github.com/railsware/newrelic_platform_plugins