diff --git a/src/api/CHANGELOG.md b/src/api/CHANGELOG.md index ec37391b..8a414abc 100644 --- a/src/api/CHANGELOG.md +++ b/src/api/CHANGELOG.md @@ -8,6 +8,11 @@ and this project adheres to ## [Unreleased] +### Added + +- Activate and configure Sentry profiling by setting the + `SENTRY_PROFILES_SAMPLE_RATE` configuration + ### Changed - Prefetch user-related groups and operational units in `get_user` dependency diff --git a/src/api/qualicharge/api/__init__.py b/src/api/qualicharge/api/__init__.py index f8f8fbe1..df1cce64 100644 --- a/src/api/qualicharge/api/__init__.py +++ b/src/api/qualicharge/api/__init__.py @@ -28,6 +28,7 @@ async def lifespan(app: FastAPI): dsn=str(settings.SENTRY_DSN), enable_tracing=True, traces_sample_rate=settings.SENTRY_TRACES_SAMPLE_RATE, + profiles_sample_rate=settings.SENTRY_PROFILES_SAMPLE_RATE, release=__version__, environment=settings.EXECUTION_ENVIRONMENT, integrations=[ diff --git a/src/api/qualicharge/conf.py b/src/api/qualicharge/conf.py index 85d4d365..7826c380 100644 --- a/src/api/qualicharge/conf.py +++ b/src/api/qualicharge/conf.py @@ -119,6 +119,7 @@ def PASSWORD_CONTEXT(self) -> CryptContext: # Third-party integrations SENTRY_DSN: Optional[HttpUrl] = None SENTRY_TRACES_SAMPLE_RATE: float = 1.0 + SENTRY_PROFILES_SAMPLE_RATE: float = 1.0 # Misc EXECUTION_ENVIRONMENT: str