NewRelic utilities


Can be set in config.ini in the [newrelic] section or in in this site newrelic section:

  • enabled (default: False)
  • config_file (default: ‘newrelic.ini’): path to newrelic.ini (relative to project root)
  • environment_name (default: ''): new relic environment name (for deployment specific settings in newrelic.ini)
  • license_key (default: ''): license key to override the one in newrelic.ini.
  • deployment_tracking_apikey (default: ''): new relic deployment tracking API key (this has to be set in

Deployment Tracking

You can track deployments and send them to New Relic’s API. There are two parts to it:

  • @newrelic.register_deployment by using this decorator the deployment info will be sent to New Relic’s API after the deployment has run through
  • newrelic.log_output() by using this context manager, you can specify which additional logging data should be sent

Example usage

from dploi_fabric import newrelic

def deploy():
    with newrelic.log_output():
    django_utils.manage('compress --force')
    run('~/bin/gunicorn restart')