Skip to content

Commit

Permalink
Add configurable environment and sample rate
Browse files Browse the repository at this point in the history
  • Loading branch information
mejroslav committed Aug 9, 2023
1 parent dd8273c commit dafba6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asab/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,7 @@ def _initialize_sentry(self):
self.TracesSampleRate = asab.Config.getfloat("sentry", "traces_sample_rate")
assert 0 <= self.TracesSampleRate <= 1.0, "Traces sample rate must be between 0 and 1."

# All of this is already happening by default!
sentry_logging = sentry_sdk.integrations.logging.LoggingIntegration(
_ = sentry_sdk.integrations.logging.LoggingIntegration(
level=logging.INFO, # Capture info and above as breadcrumbs
event_level=logging.WARNING, # Send errors as events
)
Expand All @@ -728,7 +727,8 @@ def _initialize_sentry(self):
sentry_sdk.integrations.asyncio.AsyncioIntegration(),
sentry_sdk.integrations.logging.LoggingIntegration(),
],
traces_sample_rate=1.0,
traces_sample_rate=self.TracesSampleRate,
environment=self.Environment
)

L.info("Sentry SDK initialized!")
Expand Down

0 comments on commit dafba6f

Please sign in to comment.