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.1a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b869923907e23f0789a97b299e7fa0cbf56416db110d32a865e4c5b0d6bb73 |
|
MD5 | fb639d122ece254e22d92d3d77550128 |
|
BLAKE2b-256 | f8fd9f6ed695ead9b4e14d8b96fdb942e9c47a71d789c00ad85749163167b330 |
Close
Hashes for sentry_dynamic_sampling_lib-1.1.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e9581756378f058e503305bd33ace3a6c0dc1d3e643ccdca3a0a7737975ac00 |
|
MD5 | 95c8bbd28ea855d3fb593ffe3394fd70 |
|
BLAKE2b-256 | 80ef8b40d77bbf48d66ceb7b6e4413f7f3dbf3ec92fc11a94cf458b0ad7ff7e6 |