sc.sentry provides a Plone integration with Sentry.
This package benefits from the work done on collective.sentry
- Python: 3.10, 3.11, 3.12, 3.13
- Plone: 6.0, 6.1
Add sc.sentry package to your project dependencies pip:
pip install sc.sentryor add it as a dependency on your package's setup.py
install_requires = [
...
"sc.sentry",
],This package is configured via environment variables.
| Variable | Description | Example Value | Default Value |
|---|---|---|---|
SENTRY_DSN |
Sentry's Data Source Name | https://username@foo.bar/999508778354769920 |
|
SENTRY_PROJECT |
Sentry's Project Name | My Site |
Plone |
SENTRY_ENVIRONMENT |
Environment of this installation | prod |
dev |
SENTRY_MAX_BREADCRUMBS |
Total amount of breadcrumbs that should be captured | 20 |
50 |
SENTRY_MAX_LENGTH |
The number of characters after which the values containing text in the event payload will be truncated. | 100 |
512 |
SENTRY_INTEGRATIONS |
List of integrations to enable. | sentry_sdk.integrations.sys_exit.SysExitIntegration,foo.bar.integrations.FooBar |
`` |
SENTRY_SAMPLE_RATE |
Configures the sample rate for error events, in the range of 0.0 to 1.0. The default is 1.0, which means that 100% of error events will be sent. | 0.4 |
1 |
SENTRY_DEBUG |
Turns sentry_sdk debug mode on or off. | true |
false |
Now, you can start your local Plone installation with:
make startIf you want to help with the development (improvement, update, bug-fixing, ...) of sc.sentry this is a great idea!
We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.
You will need to have uv installed in your environment.
Then install the dependencies and create a development instance using:
make installTo format the codebase -- including sorting the imports according to the Plone style guide -- please run the command:
make formatThis will take care of running ruff and zpretty.
Please run the command:
make lintThis will check:
- Python code formatting
- Python import ordering
- XML and ZCML code formatting
- Typing coverage
- Package metadata
- Python versions
Testing of this package is done with pytest.
| Command | Command |
|---|---|
| Run all tests | make test |
| Run coverage report | make test-cov |
| Run tests, stop on the first error | uv run pytest -x --pdb |
Run only tests with names matching TestSettings |
uv run pytest -k TestSettings |
The project is licensed under GPLv2.
Originally made in Brasília, Brazil, with love, by your friends @ Simples Consultoria.