--- id: structlog-sentry version: "2.2.1" license: MIT license_treatment: permissive maintenance: dormant --- # structlog-sentry — Sentry integration for structlog License: permissive · Maintenance: dormant · Downloads: 4.4M/mo ## What it is and what it does structlog-sentry is a processor plugin that integrates the Sentry error tracking service with structlog's structured logging framework. It automatically captures log events at configurable severity levels and sends them to Sentry as either breadcrumbs (for lower-severity logs) or full events (for errors and above). The processor sits in structlog's processing pipeline and converts structured log data—including exception info, custom fields, and metadata—into Sentry's event format, with options to tag events, filter specific loggers, and control what context is sent. You configure it by adding SentryProcessor to your structlog pipeline after the log-level processor, then log normally with structlog; any logs meeting the event_level threshold automatically appear in Sentry. It supports exception capture, custom tags from log fields, breadcrumb filtering, and per-call opt-out via sentry_skip=True. The package is designed for applications already using both structlog and Sentry, eliminating the need to maintain separate instrumentation for each. Use it for: - Capture application errors logged via structlog and surface them in Sentry's dashboard without duplicating logging calls. - Send structured context from logs as Sentry tags and breadcrumbs for better error correlation. - Automatically report exceptions with sys.exc_info() to Sentry when you call log.error() in exception handlers. - Filter out noisy loggers or skip Sentry reporting for specific log calls while keeping them in local logs. - Integrate structlog JSON output with Sentry for centralized error tracking in monitoring stacks. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Bridges structlog and Sentry to automatically capture structured logs as Sentry events and breadcrumbs, with configurable thresholds and filtering. Yes, if you already use both structlog and Sentry. It eliminates boilerplate and keeps error tracking in sync with your structured logging. The low install friction and permissive license make it a straightforward addition. Dormant maintenance is a minor concern—the package is stable and the last commit is recent—but monitor for breaking changes in structlog or sentry-sdk if you adopt it for a new project. ## Install pip install structlog-sentry uv add structlog-sentry poetry add structlog-sentry ## Installing structlog-sentry Before you install: Low friction: pure Python wheel with only two runtime dependencies (sentry-sdk and structlog). Maintenance is dormant—last release was 640 days ago, but the repo remains active with a recent commit on 2025-02-18 and no archived status. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install structlog-sentry import logging import sentry_sdk import structlog from structlog_sentry import SentryProcessor sentry_sdk.init() structlog.configure( processors=[ structlog.stdlib.add_log_level, SentryProcessor(event_level=logging.ERROR), ], logger_factory=structlog.stdlib.LoggerFactory(), wrapper_class=structlog.stdlib.BoundLogger, ) log = structlog.get_logger() log.error("error message") Requires structlog and sentry-sdk to be installed; SentryProcessor must be placed after add_log_level in the processor chain. Verify before relying: - Whether dormant maintenance (640 days since release) poses a risk for future Python or dependency updates. - Performance impact of automatic Sentry event capture on high-volume logging workloads. - Whether custom fields passed to log calls are reliably sent as Sentry context or tags. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 4.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags structlog sentry integration, send structured logs to sentry, sentry error tracking with structlog, structlog processor sentry, structured logging error monitoring, sentry breadcrumbs from logs, log aggregation sentry, error-tracking, structured-logging [View on SkillFed](https://skillfed.io/packages/structlog-sentry) · [View on PyPI](https://pypi.org/project/structlog-sentry/)