Rollbar Python SDK (pyrollbar) provides easy and powerful exception tracking with Rollbar. It allows sending messages and exceptions with arbitrary context, enabling aggregation and quick debugging of production issues. The current stable version is 1.3.0, with active development including regular minor and patch releases, and support for newer Python versions.
pip install rollbarVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Rollbar SDK and report both an exception and a simple message. Remember to replace 'YOUR_ROLLBAR_ACCESS_TOKEN' with your actual token, preferably via an environment variable. For background thread reports to complete on exit, consider `rollbar.wait()` if the application terminates quickly.
Upgrade your Python environment to version 3.7 or higher. Rollbar Python SDK v1.3.0 supports Python 3.7 to 3.13.
Ensure `rollbar.init()` is called once at the start of your application's lifecycle with correct `access_token` and `environment` values.
For applications that terminate quickly, call `rollbar.wait()` to ensure all buffered items are sent before the process exits. For web applications, this is typically handled by the framework integration.
Review the data being sent to Rollbar. If truncation is an issue, consider adjusting configuration options like `locals_max_size` or implementing custom payload transforms (v1.2.0+) to filter sensitive or excessively large data.
Consult the Rollbar documentation for your specific web framework and implement the recommended integration (e.g., `rollbar.contrib.django.middleware.RollbarMiddleware`).
pip install rollbar
rollbar.init({'access_token': 'YOUR_ROLLBAR_ACCESS_TOKEN', 'environment': 'production'})pip install 'rollbar[flask]'
from rollbar import report_exc_info # or use rollbar.report_exc_info()
No dependency data recorded yet.