-
Notifications
You must be signed in to change notification settings - Fork 8
feat(sentry): add starlite sentry integration #239
Conversation
e6e629d
to
add0928
Compare
add0928
to
43adbbe
Compare
So the way the sentry integration globally patches starlite means that if you run that failing test on its own, it passes as So I think we just disable sentry for the tests, thoughts @gazorby? |
Yes it's better to disable it for unit tests, but maybe we can do something in the integration environement? I just saw that from starlite import Starlite
from sentry_sdk.integrations.starlite import SentryStarliteASGIMiddleware
def test_sentry(app):
old_init = Starlite.__init__
async with LifespanManager(app):
assert isinstance(app.middleware[0], SentryStarliteASGIMiddleware)
Starlite.__init__ = old_init |
Also, what do you think about disabling sentry when ENVIRONMENT == "local"? |
It would be nice to have the sentry integration enabled somewhere within the tests to pick up any side-effects of having it activated before deploying. I'd even be happy to run the whole integration test suite with it activated - perhaps we can use the I've still got to fix that integration test that has been x-failed. If you want to do it in this PR or another, I'm easy.
Yes, makes sense, and have the implicit setting able to be overridden by environment like we did for reloading. |
7830dd0
to
39dfd9d
Compare
Kudos, SonarCloud Quality Gate passed! |
* ✨ feat(sentry): add starlite sentry integration * ✅ test(sentry): add traces sampler test * feat(sentry): disabled by default if environment "local" or "test" Co-authored-by: Peter Schutt <[email protected]>
Closes #52