Quick Start

Get Started with the Python Agent

Installing the Agent

Installing the Bearer Agent generally only takes a few minutes. You will need an account on Bearer.sh to obtain your secret key. For details on which Python versions Bearer supports, have a look at Compatibility.

To enable the Bearer Agent within your application, you'll need to:

  1. Install the Agent and initialize it in your application.

  2. Set up any optional configuration settings.

Install the bearer-agent with pip:

pip install bearer-agent

Minimum configuration

Now, open your application's main process file and initialize the Bearer agent at the top:

import bearer_agent
bearer_agent.init(secret_key="YOUR_SECRET_KEY", strip_sensitive_data=True)

Your Bearer Secret Key, secret_key, can be found in the settings for your app on the Bearer Dashboard at Settings > Keys. Each application you have created in the Bearer Dashboard has its own unique key.

Now, you can start your application. All API calls will be monitored and available on your Bearer dashboard.

We strongly recommend initializing the Bearer agent as early as possible in your codebase. This ensures that all external HTTP requests performed on your application are monitored.

Start monitoring your APIs 🚀

With the Agent set up, you can begin monitoring your APIs on the Bearer Dashboard. To learn more about the features available on the Dashboard and how to get started, explore our Get to Know the Dashboard documentation.

Communication with Bearer

The Bearer agent communicates with Bearer servers through HTTPS. The Agent requires your firewall to allow outgoing connections to agent.bearer.sh with port 443 (HTTPS).

By default, the Agent sends to the full payload of each HTTP request (including both the request and the response) to Bearer. By default and for your own security, the Authorization header is filtered and will not be shared with Bearer.

The agent offers more options to reduce the amount of sensitive information sent to Bearer. To learn more about how to sanitize specific parts of your data, see the Keep your Data Protected documentation.

What if Bearer is experiencing a downtime? The Bearer agent has been built with resiliency in mind. If, for any reason, Bearer servers are experiencing unexpected latency, this will not affect your application.