Skip to content

simplesconsultoria/sc.sentry

Repository files navigation

logo

sc.sentry

PyPI PyPI - Python Version PyPI - Wheel PyPI - License PyPI - Status

PyPI - Plone Versions

Code Quality Tests

GitHub contributors GitHub Repo stars

sc.sentry provides a Plone integration with Sentry.

This package benefits from the work done on collective.sentry

Installation

Requirements

  • 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.sentry

or add it as a dependency on your package's setup.py

    install_requires = [
        ...
        "sc.sentry",
    ],

Configuration

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

Starting Plone

Now, you can start your local Plone installation with:

make start

Contributing

If 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.

Local Development

You will need to have uv installed in your environment.

Then install the dependencies and create a development instance using:

make install

Format the codebase

To format the codebase -- including sorting the imports according to the Plone style guide -- please run the command:

make format

This will take care of running ruff and zpretty.

Quality assurance

Please run the command:

make lint

This will check:

  • Python code formatting
  • Python import ordering
  • XML and ZCML code formatting
  • Typing coverage
  • Package metadata
  • Python versions

Run tests

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

License

The project is licensed under GPLv2.

One Last Thing

Originally made in Brasília, Brazil, with love, by your friends @ Simples Consultoria.

About

Sentry instrumentation for Plone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors