4.6 KiB
4.6 KiB
IronTelemetry SDK for Python
Error monitoring and crash reporting for Python applications
Website • Documentation • Python Guide • Git
IronTelemetry helps you capture exceptions, track user journeys, and get actionable insights to fix issues faster. Built for developers who want simple, powerful error monitoring without the complexity.
Features
- Exception Capture - Automatically capture and report exceptions with full stack traces
- Journey Tracking - Understand what users did before an error occurred
- Breadcrumbs - Add context with custom breadcrumbs and metadata
- Framework Support - Built-in integrations for Django, Flask, FastAPI
- Async Support - Full async/await support
- Type Hints - Complete type annotations for IDE support
- Offline Queue - Events are queued when offline and sent when connectivity returns
Installation
pip install irontelemetry
Quick Start
Initialize the SDK
import irontelemetry
irontelemetry.init("https://pk_live_xxx@irontelemetry.com")
Capture Exceptions
try:
do_something()
except Exception as e:
irontelemetry.capture_exception(e)
raise
Track User Journeys
with irontelemetry.start_journey("Checkout Flow"):
irontelemetry.set_user("user-123", "user@example.com")
with irontelemetry.start_step("Validate Cart", "business"):
validate_cart()
with irontelemetry.start_step("Process Payment", "business"):
process_payment()
with irontelemetry.start_step("Send Confirmation", "notification"):
send_confirmation_email()
Add Breadcrumbs
from irontelemetry import add_breadcrumb, BreadcrumbCategory
add_breadcrumb("User clicked checkout button", BreadcrumbCategory.UI)
add_breadcrumb("Payment API called", BreadcrumbCategory.HTTP)
Framework Integrations
Django
# settings.py
INSTALLED_APPS = [
'irontelemetry.django',
# ...
]
IRONTELEMETRY_DSN = "https://pk_live_xxx@irontelemetry.com"
Flask
from flask import Flask
from irontelemetry.flask import IronTelemetry
app = Flask(__name__)
IronTelemetry(app, dsn="https://pk_live_xxx@irontelemetry.com")
FastAPI
from fastapi import FastAPI
from irontelemetry.fastapi import IronTelemetryMiddleware
app = FastAPI()
app.add_middleware(IronTelemetryMiddleware, dsn="https://pk_live_xxx@irontelemetry.com")
Configuration
from irontelemetry import TelemetryOptions, init
init(TelemetryOptions(
dsn="https://pk_live_xxx@irontelemetry.com",
environment="production",
app_version="1.2.3",
sample_rate=1.0,
debug=False,
before_send=lambda event: event if "expected" not in (event.message or "") else None,
))
Documentation
For complete documentation, visit irontelemetry.com/docs.
Other SDKs
| Platform | Package |
|---|---|
| JavaScript/TypeScript | @ironservices/telemetry |
| .NET | IronTelemetry.Client |
| Go | irontelemetry-go |
| Java | irontelemetry-java |
| Rust | irontelemetry |
Support
- Documentation: irontelemetry.com/docs
- Email: dev@ironservices.io
- Issues: git.marketally.com/ironservices/irontelemetry-python/issues
License
MIT License - see LICENSE for details.