Skip to content

Commit

Permalink
🔧(api) collect sentry profiling traces
Browse files Browse the repository at this point in the history
We need more insights to analyze API performances.
  • Loading branch information
jmaupetit committed Dec 13, 2024
1 parent dbde66a commit a2e5ab0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/api/qualicharge/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
1 change: 1 addition & 0 deletions src/api/qualicharge/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2e5ab0

Please sign in to comment.