Skip to main content

collective.sentry

Sentry integration with Zope.

Quick start (zero config)

Install collective.sentry alongside your Zope/Plone instance and set:

SENTRY_DSN=https://<key>@<host>/<project-id>

Optional environment variables:

  • SENTRY_ENVIRONMENT — the environment tag (e.g. production).

  • SENTRY_PROJECT — set as tag project on every event.

  • SENTRY_DISABLE — set to disable Sentry entirely.

  • SENTRY_INTEGRATIONS — comma-separated dotted names of extra sentry-sdk integration classes (instantiated without arguments).

  • SENTRY_MAX_LENGTH — maps to sentry-sdk’s max_value_length; unset keeps the SDK default.

  • SENTRY_OPTIONAL — deprecated, ignored (a missing DSN just disables reporting).

In Plone the package is picked up automatically (z3c.autoinclude). On plain Zope, import the package once at startup, e.g. from the WSGI module:

import collective.sentry  # noqa: F401

Own initialization (filtering etc.)

The env-var bootstrap steps aside when the SDK is already initialized, so you can call sentry_sdk.init() yourself — for example to filter scanner noise with before_send, which since 2.0 belongs to you:

import sentry_sdk
from collective.sentry import ZopeIntegration

def drop_scanner_noise(event, hint):
    # your filtering logic
    return event

sentry_sdk.init(
    dsn="...",
    integrations=[ZopeIntegration()],
    before_send=drop_scanner_noise,
    ignore_errors=[KeyboardInterrupt],
)

Run this before Zope loads the package ZCML (policy package module level, or a paste filter in wsgi.ini).

What gets reported

Unhandled publisher exceptions (via IPubFailure) and logging errors, enriched per request with form data, cookies, lazy items, request info and the authenticated user (email included when the user has PAS properties, i.e. always in Plone). Passwords are filtered. Exception types listed as ignored in the site’s error_log are not reported.

Migrating from 1.x

  • before_send is no longer occupied by this package; wrappers around collective.sentry.error_handler.before_send can be replaced by a plain before_send passed to your own sentry_sdk.init().

  • collective.sentry.error_handler is deprecated (works, warns).

  • SENTRY_INTEGRATIONS works again (it was silently broken since 1.x/2022).

  • SENTRY_MAX_LENGTH now only applies when explicitly set.

  • plone.api is no longer a dependency; plain Zope 5 is supported.

  • Transaction names are now the request path — review Sentry alert rules that filter on transaction.

  • The deprecated error_handler.before_send shim only enriches — the error_log ignore check moved to the capture path (relevant only if you call the shim directly).

  • extra["request"]["headers"] now contains proper header names (HTTP_* transformed, non-header environ keys dropped, sensitive headers filtered) instead of the raw WSGI environ.

2.0.1 (2026-10-23)

Bug fixes:

  • Fix events from a running instance missing all request data (form, cookies, request info, user, transaction name) and carrying breadcrumbs of earlier requests: wrap ZPublisher.WSGIPublisher.transaction_pubevents instead of publish_module, which Zope’s make_wsgi_app binds before this package is loaded. [szakitibi] (#45)

Tests:

  • Run the functional tests through the standard plone.testing browser, which binds publish_module like make_wsgi_app does, and drop the LateBindingBrowser workaround. [szakitibi] (#45)

2.0.0 (2026-09-23)

Breaking changes:

  • Rewrite as a proper sentry_sdk ZopeIntegration: per-request isolation scope with lazy enrichment, before_send freed for deployers, plone.api dependency dropped (plain Zope 5 supported), error_handler deprecated as BBB shim. SENTRY_MAX_LENGTH now only applies when explicitly set; SENTRY_OPTIONAL is deprecated and ignored. [jensens] (#40)

New features:

  • Env-var bootstrap yields to a deployer’s own sentry_sdk.init(); SENTRY_INTEGRATIONS works again (silently broken since 2022, #40). [jensens] (#40)

Tests:

  • Add unit and Plone functional test suites, plus a Zope-only tox env and CI job proving the package runs without Plone. [jensens] (#40)

Changelog

1.0.0 (2026-06-17)

Breaking changes:

  • Drop support for Plone 5.2 and Python 3.8. (#28)

  • Replace pkg_resources namespace with PEP 420 native namespace. Support only Plone 6.2 and Python 3.10+. (#3928)

Bug fixes:

  • Handle non exceptions that caused a traceback @gforcada (#29)

Internal:

  • Update configuration files. Move to src-layout. [plone devs]

0.3.3 (unreleased)

  • Nothing changed yet.

0.3.2 (2023-11-07)

  • Fix SENTRY_MAX_LENGTH default value again. [Lunga001]

0.3.1 (2023-10-11)

  • Fix SENTRY_MAX_LENGTH default value. [folix-01]

0.3.0 (2022-10-06)

  • Add environment var to disable sentry integration. [krissik]

0.2.6 (2022-07-28)

  • Fix a problem on errorRaisedSubscriber function that was missing the exc_info variable. [thomasmassmann]

0.2.5 (2022/07/26)

  • Add optional environment parameter for Sentry integrations (“SENTRY_INTEGRATIONS”, comma separated list) [2silver]

  • Ensure all exceptions which should be ignored are actually ignored before sending them. [thomasmassmann]

0.2.4 (2020/09/07)

  • Ignore exceptions that are ignored in the root Zope error_log. [maurits]

0.2.3 (2020/08/05)

  • Fix error handling on zope site root [krissik]

0.2.2 (2020/07/13)

  • Add check with error_log ignored_exceptions before send exceptions to sentry [eikichi18]

0.2.1 (2020/07/08)

  • Add SENTRY_ENVIRONMENT option. [fulv]

0.2.0 (2019/11/28)

  • Add optional environment parameter to set max length of stacktrace (“SENTRY_MAX_LENGTH”, default is 512) [Thokas]

0.1.7 (2019/10/21)

  • Make collective.sentry configuration optional (do not load if no SENTRY_DSN) [kiorky]

0.1 (2019/08/15)

  • initial release

Contributors

Metadata

Release files for collective.sentry 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.sentry 2.0.1
File Size Uploaded Provenance Actions
collective_sentry-2.0.1.tar.gz 19.8 kB Without provenance Details for collective_sentry-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for collective.sentry 2.0.1
File Interpreter ABI Platform Actions
collective_sentry-2.0.1-py3-none-any.whl Python 3 none any Details for collective_sentry-2.0.1-py3-none-any.whl

Total release size: 40.7 kB

Release files / collective_sentry-2.0.1.tar.gz

Download URL collective_sentry-2.0.1.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
28cfb338085cde0e67176f8ad3efb85220e343dfa444a13dd3c9ed9929d93470
BLAKE2b-256 checksum
How to use checksums
b04f1db903f29b9fe443a413a62e237b0e75f4001715ed11284f121122ee5c3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / collective_sentry-2.0.1-py3-none-any.whl

Download URL collective_sentry-2.0.1-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
289914bf7f7b974c36c806dd4559ed3d1e96f7218d7df72348a9177385d4ded4
BLAKE2b-256 checksum
How to use checksums
62df177797110c05dc048e648f953d883c99be2054f550e81aabc2980bddba9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for collective.sentry 2.0.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page