👨💻 Flaxon Sentry Plugin
Sentry error tracking and performance monitoring for Flaxon framework.
Table of Contents
Installation
pip install flaxon-sentry
Quick Start
from flaxon import Flaxon
from flaxon_sentry import SentryPlugin
app = Flaxon("my-app")
# Load Sentry plugin
await app.plugins.load_plugin(SentryPlugin(
dsn="https://your-sentry-dsn",
environment="production",
release="1.0.0",
))
@app.get("/")
async def home():
return {"message": "Hello with Sentry!"}
Features
- Error capture — Automatically captures exceptions and sends to Sentry
- Request context — Adds request data to Sentry events (method, path, user, etc.)
- Performance tracking — Transaction timing for routes
- User tracking — Associates errors with users
- Custom tags — Add custom tags to events
- Ignore patterns — Configure which errors to ignore
Configuration
Environment Variables
export SENTRY_DSN=https://your-sentry-dsn
export SENTRY_ENVIRONMENT=production
export SENTRY_RELEASE=1.0.0
export SENTRY_SAMPLE_RATE=1.0
export SENTRY_TRACES_SAMPLE_RATE=0.1
With Flaxon Config
app = Flaxon("my-app", config={
"SENTRY_DSN": "https://your-sentry-dsn",
"ENV": "production",
})
plugin = SentryPlugin.from_config(app.config)
await app.plugins.load_plugin(plugin)
Advanced Usage
User Context
def get_user_from_request(request):
return {
"id": request.user.id,
"email": request.user.email,
"username": request.user.username,
}
plugin = SentryPlugin(dsn="...")
plugin.set_user_getter(get_user_from_request)
await app.plugins.load_plugin(plugin)
Manual Exception Capture
@app.post("/users")
async def create_user(request):
try:
# Some operation
pass
except Exception as e:
app.state.sentry_plugin.capture_exception(e, request)
return {"error": "Failed to create user"}
Adding Breadcrumbs
@app.get("/process")
async def process(request):
app.state.sentry_plugin.add_breadcrumb(
"Starting process",
category="process",
level="info",
data={"user_id": 123}
)
# Process...
License
MIT
Metadata
Release files for flaxon-sentry 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flaxon_sentry-0.1.3.tar.gz | 10.7 kB | Without provenance | Details for flaxon_sentry-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flaxon_sentry-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for flaxon_sentry-0.1.3-py3-none-any.whl |
Total release size: 19.9 kB
Release files / flaxon_sentry-0.1.3.tar.gz
| Download URL | flaxon_sentry-0.1.3.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67b867bc32c9c58d8a85ff4c74399c6c1920e0529ce93414919061d101eb3a39
|
|
BLAKE2b-256 checksum How to use checksums |
ba2a6a0928a10ebf65146aecf2293936facc547e104003b0fd5efce92bfcdc87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / flaxon_sentry-0.1.3-py3-none-any.whl
| Download URL | flaxon_sentry-0.1.3-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c10d45b0130c4bee1a0b7cc6b97be11f6929bb29642b34102ebd85d69646bdb
|
|
BLAKE2b-256 checksum How to use checksums |
e1d14828d1164bc36cb53f26ada1b4395f367ee0f32229cb11e31680cd02b226
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for flaxon-sentry 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.