You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on making Sentry initialization optional to control its usage across different deployment environments. This will allow us to enable Sentry selectively based on the deployment environment. On the frontend, I have updated some options for this purpose. PR #2449. Your feedback is welcome and appreciated.
On the backend, Sentry is currently initialized every time an exception is triggered because it is integrated with the exception handler. A better approach would be to initialize the Sentry service once when the application starts and then use it only to send reports when exceptions occur, instead of reinitializing and sending reports on each exception.
Current Sentry Integration on Backend
exceptionHandler :: VVAConfig -> Maybe Request -> SomeException -> IO ()
exceptionHandler vvaConfig mRequest exception = do
print mRequest
print exception
let isNotTimeoutThread x = case fromException x of
Just TimeoutThread -> False
_ -> True
isNotConnectionClosedByPeer x = case fromException x of
Just ConnectionClosedByPeer -> False
_ -> True
guard . isNotTimeoutThread $ exception
guard . isNotConnectionClosedByPeer $ exception
let env = sentryEnv vvaConfig
sentryService <-
initRaven
(sentryDSN vvaConfig)
id
sendRecord
silentFallback
register
sentryService
"vva.be"
Error
(formatMessage mRequest exception)
(recordUpdate env mRequest exception)
```
The text was updated successfully, but these errors were encountered:
Updated the application to initialize the Sentry service at the
beginning of the app lifecycle rather than during each exception
occurrence. This change ensures that the Sentry service is set up once
when the application starts, saving resources and potentially increasing
the application's performance by avoiding repetitive initializations.
The Sentry service is passed to the exception handler during setup and
is used consistently throughout the application's uptime. This aligns
with the user story's requirement to optimize exception handling
efficiency by centralizing Sentry service initialization.
Context
I am working on making Sentry initialization optional to control its usage across different deployment environments. This will allow us to enable Sentry selectively based on the deployment environment. On the frontend, I have updated some options for this purpose. PR #2449. Your feedback is welcome and appreciated.
On the backend, Sentry is currently initialized every time an exception is triggered because it is integrated with the exception handler. A better approach would be to initialize the Sentry service once when the application starts and then use it only to send reports when exceptions occur, instead of reinitializing and sending reports on each exception.
Current Sentry Integration on Backend
The text was updated successfully, but these errors were encountered: