A forwarding agent for Bugsnag to minimize reporting impact

pip install bugsnag-agent==1.2.1


The Bugsnag agent forwards reports from your server to bugsnag.com or an on-premise Bugsnag installation. It's used to avoid any latency impact that might occur if you need to make a call over the network in every exception handler.

Getting started

First you need to download the bugsnag-agent from here and make it executable on your server. For example:

$ pip install bugsnag-agent

Next you need to run it.

$ bugsnag-agent
Bugsnag Agent started. -> https://notify.bugsnag.com/

You can verify that it's running using curl in another terminal:

$ curl
Bugsnag agent: -> https://notify.bugsnag.com/ (0/1000)%

Finally you need to configure the endpoint of your Bugsnag apps to be http://localhost:3829. This differs per notifier, but for example PHP is:



If you'd like to ensure Bugsnag is always running, you can save the following upstart script as /etc/init/bugsnag.conf and then run sudo start bugsnag.

description "Bugsnag forwarding agent"
author      "Bugsnag <support@bugsnag.com>"

start on (filesystem and net-device-up IFACE=lo)
stop on shutdown

respawn limit 99 5

console log

    exec bugsnag-agent
end script


If you'd like to configure Bugsnag to be managed by systemd instead, drop the following into /etc/systemd/system/bugsnag-agent.service:

Description="Bugsnag Agent"



After that, reload the systemd daemon, enable the service (so that it runs at boot) and start it:

sudo systemctl daemon-reload
sudo systemctl enable bugsnag-agent.service
sudo systemctl start bugsnag-agent.service


bugsnag-agent reads /etc/bugsnag.conf if it exists. The default configuration is:

# Default configuration for bugsnag.

# The port to listen on.
port = 3829

# The interfact to listen on. Set this to if you want to allow anyone
# to forward to Bugsnag. If you do that, ensure that this process is firewalled
# off from the global internet.
listen =

# The endpoint to send exceptions to. This can be another `bugsnag-agent`,
# https://notify.bugsnag.com/ or your local on-premise Bugsnag.
endpoint = https://notify.bugsnag.com/

# Logging verbosity
log_level = INFO

You can change which configuration file is used with the -c parameter:

bugsnag-agent -c /usr/local/etc/bugsnag.conf

All the options can also be set directly using command line flags:

bugsnag-agent --port 3829 --listen --endpoint https://notify.bugsnag.com/ --log-level INFO


bugsnag-agent is copyright under the MIT license. See LICENSE.MIT for details.

Bug reports and pull requests are welcome.