Steadwing Python SDK — auto-captures exceptions, error logs and HTTP breadcrumbs
Project description
Steadwing Python SDK
Auto-captures exceptions, error logs, and HTTP breadcrumbs from Python applications and sends them to the Steadwing backend for Root Cause Analysis.
Installation
pip install steadwing
Quick Start
import steadwing
steadwing.init(
api_key="st_your_api_key",
service="payment-service",
environment="production",
)
That's it. The SDK will automatically:
- Capture unhandled exceptions (including in threads)
- Capture
logging.error()andlogging.critical()calls - Record outgoing HTTP requests as breadcrumbs
- Send heartbeats every 60 seconds
- Patch FastAPI to capture route errors with request context (if installed)
Configuration
steadwing.init(
api_key="st_...", # Required: your API key
service="my-service", # Required: service name
environment="production", # Optional: defaults to "production"
enabled=True, # Optional: set False to disable
backend_url="https://...", # Optional: override backend URL
)
The backend URL can also be set via the STEADWING_BACKEND_URL environment variable.
Manual Capture
import steadwing
# Capture a specific exception
try:
risky_operation()
except Exception as e:
steadwing.capture_exception(e)
# Capture the current exception (in an except block)
try:
risky_operation()
except Exception:
steadwing.capture_exception()
# Capture a message
steadwing.capture_message("Deployment completed", level="info")
What Gets Captured
Exceptions
- Full stack trace with local variables
- Exception chain (
__cause__,__context__) - Last 100 breadcrumbs leading up to the error
- Request context (for FastAPI routes)
Logs
logging.error()andlogging.critical()are sent as events- All log levels are recorded as breadcrumbs
Breadcrumbs
- Outgoing HTTP requests (method, URL, duration)
- Log messages at any level
- Rolling buffer of last 100 entries
Data Scrubbing
Sensitive data is automatically scrubbed from captured events. Keys matching the following patterns (case-insensitive) have their values replaced with [REDACTED]:
password, passwd, secret, api_key, apikey, token, auth, authorization, cookie, csrf, session, credit_card, ssn
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run specific tests
pytest tests/test_scrubber.py -v
Requirements
- Python >= 3.10
- httpx >= 0.24.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steadwing-0.1.0.tar.gz.
File metadata
- Download URL: steadwing-0.1.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bcb2c8e875be46bcfcc2a88196a6ad0bbbc23ec935e9eeea22bd89543364989
|
|
| MD5 |
807e9c698e43dfb882b734c30d521cee
|
|
| BLAKE2b-256 |
53563e5f4a20f5d029acd189150c271f269858b66e601cb6389d4fb6ab03cecc
|
File details
Details for the file steadwing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: steadwing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac54758a2ba64fcbe7df8bb85866d2e586fd7528a8ad8bd18042d91a7b2bf939
|
|
| MD5 |
bf01928c0d419ea94a15970281b3783b
|
|
| BLAKE2b-256 |
f95e76362a271a866475c21c970cc0a8df7163094d136dc1f6de37f4e558fc68
|