Registry / observability / rollbar

rollbar

JSON →
library1.4.0pypypi✓ verified 26d ago

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 rollbar
INSTALL
IMPORT
SIG · ROLLBAR
R
rollbar
observabilitypythonv1.4.0
Install
2.2s avg
Import
379ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.394s · 22.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.364s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

init
import rollbar rollbar.init(...)
from rollbar import init # while technically possible, typically rollbar is imported as a module and init called on it for clarity.
Initializes the Rollbar SDK with configuration.
report_exc_info
import rollbar rollbar.report_exc_info()
Reports the current exception info to Rollbar.
report_message
import rollbar rollbar.report_message('Hello Rollbar!')
Reports a simple message to Rollbar.
RollbarHandler
from rollbar.logger import RollbarHandler
Logging handler for integrating with Python's standard logging module.

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.

import rollbar import os # Configure Rollbar rollbar.init( access_token=os.environ.get('ROLLBAR_ACCESS_TOKEN', 'YOUR_ROLLBAR_ACCESS_TOKEN'), environment='development', root=os.path.dirname(os.path.abspath(__file__)) ) def main(): try: raise ValueError("This is a test error from Rollbar Python SDK!") except Exception: rollbar.report_exc_info() print("Error reported to Rollbar.") rollbar.report_message("Application started successfully.", level='info') print("Message reported to Rollbar.") # In a real application, ensure background threads have time to send data # before exiting. For simple scripts, you might need rollbar.wait(). # rollbar.wait() if __name__ == '__main__': main()
rollbar --version
Debug
Known issues
breakingSupport for Python 3.6 was removed in Rollbar Python SDK v1.3.0. Installations on Python 3.6 will fail or encounter issues.
fix
Upgrade your Python environment to version 3.7 or higher. Rollbar Python SDK v1.3.0 supports Python 3.7 to 3.13.
affects: >=1.3.0
gotchaThe `rollbar.init()` call must occur before any `rollbar.report_*` functions are called. Incorrect or missing `access_token` or `environment` parameters will prevent reports from being sent.
fix
Ensure `rollbar.init()` is called once at the start of your application's lifecycle with correct `access_token` and `environment` values.
affects: All
gotchaRollbar uses background threads to send reports asynchronously. If your application exits immediately after an error, reports may not be sent. For command-line scripts or short-lived processes, `rollbar.wait()` might be necessary before exit.
fix
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.
affects: >=1.0.0
gotchaReports with very large payloads (e.g., huge local variables or deep call stacks) may be truncated due to size limits. The SDK has internal shortening logic (improved in v1.1.0-alpha).
fix
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.
affects: All
gotchaFor popular web frameworks (Django, Flask, FastAPI, Pyramid), it's highly recommended to use the dedicated Rollbar integrations (e.g., middleware) rather than just `rollbar.init()`. These integrations handle context, request data, and proper error capturing within the framework's lifecycle.
fix
Consult the Rollbar documentation for your specific web framework and implement the recommended integration (e.g., `rollbar.contrib.django.middleware.RollbarMiddleware`).
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rollbar'
The rollbar package has not been installed in the current Python environment.
fix
pip install rollbar
KeyError: 'access_token' (during rollbar.init() call)
The required 'access_token' configuration key is missing or misspelled in the dictionary passed to `rollbar.init()`.
fix
rollbar.init({'access_token': 'YOUR_ROLLBAR_ACCESS_TOKEN', 'environment': 'production'})
ModuleNotFoundError: No module named 'rollbar.contrib.flask'
A framework-specific integration module (like Flask, Django, Pyramid) was imported without installing the corresponding Rollbar extra.
fix
pip install 'rollbar[flask]'
ImportError: cannot import name 'report_exception' from 'rollbar'
Attempted to import a non-existent function name; the correct function to report exceptions is `report_exc_info`.
fix
from rollbar import report_exc_info
# or use rollbar.report_exc_info()
Upgrade
Version history
1.4.0latest on PyPI · released Jul 10, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
2
Resources
rollbar — pip install rollbar · libregistry