No project description provided
Project description
Sentry Dynamic Sampling Controller
This project aims to provide dynamic sampling without relying on Sentry own's Dynamic Sampling.
This libs works by adding a traces_sampler
callback to sentry.
In the background a thread fetch the data from the controller
It's also able to ignore WSGI route an Celery task set in controller.
Usage
import sentry_sdk
from sentry_dynamic_sampling_lib import init_wrapper
# init sentry as usual
# without traces_sampler and sample_rate param
sentry_sdk.init( # pylint: disable=E0110
dsn=SENTRY_DSN,
integrations=[],
environment=ENVIRONMENT,
release=SENTRY_RELEASE,
)
# hook sentry_dynamic_sampling_lib into sentry
init_wrapper()
Configuration
The following environment variables can be used to configure the lib
SENTRY_CONTROLLER_HOST=none # (required, no default)
SENTRY_CONTROLLER_PATH="/sentry/apps/{}/" # (optional, default to example)
SENTRY_CONTROLLER_METRIC_PATH="/sentry/apps/{}/metrics/{}/" # (optional, default to example)
SENTRY_CONTROLLER_POLL_INTERVAL=60 # (optional, default to example)
SENTRY_CONTROLLER_METRIC_INTERVAL=600 # (optional, default to example)
Development
# install deps
poetry install
# pre-commit
poetry run pre-commit install --install-hook
poetry run pre-commit install --install-hooks --hook-type commit-msg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sentry_dynamic_sampling_lib-1.1.0a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c720f10a0eefa5cde94b0d43d573dad7267d35aa9e63babe80e30c78104feae5 |
|
MD5 | 6e534f5855ba9f87fb418fee0a0c68c5 |
|
BLAKE2b-256 | ec7d013b69d84f7816ae6ecf879df68ea4b7f7ccb0cdfa714b7cde0ce755cb82 |
Close
Hashes for sentry_dynamic_sampling_lib-1.1.0a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b46b5b7a3688531c1103889587a657cb394e8c603dfe8fed142da20917f90ce |
|
MD5 | 745dba67c50ae2e667b2068181480268 |
|
BLAKE2b-256 | 72d455d4e2ba63a470fc84a245ff42da092e2345f54fe9a39d1431fc84cf1dae |