File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 88import sentry_sdk
99from fastapi import FastAPI , Request
1010from fastapi .staticfiles import StaticFiles
11- from sentry_sdk .integrations .asgi import SentryAsgiMiddleware
11+ from sentry_sdk .integrations .fastapi import FastApiIntegration
12+ from sentry_sdk .integrations .starlette import StarletteIntegration
1213
1314from jbi .environment import get_settings
1415from jbi .log import format_request_summary_fields
1819
1920settings = get_settings ()
2021
22+ sentry_sdk .init (
23+ dsn = settings .sentry_dsn ,
24+ integrations = [
25+ StarletteIntegration (),
26+ FastApiIntegration (),
27+ ],
28+ # Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring.
29+ # TODO: Sentry recommends adjusting this value in production # pylint: disable=fixme
30+ traces_sample_rate = 1.0 ,
31+ )
32+
2133
2234app = FastAPI (
2335 title = "Jira Bugzilla Integration (JBI)" ,
2941app .include_router (router )
3042app .mount ("/static" , StaticFiles (directory = SRC_DIR / "static" ), name = "static" )
3143
32- sentry_sdk .init ( # pylint: disable=abstract-class-instantiated # noqa: E0110
33- dsn = settings .sentry_dsn
34- )
35- app .add_middleware (SentryAsgiMiddleware )
36-
3744
3845@app .middleware ("http" )
3946async def request_summary (request : Request , call_next ):
You can’t perform that action at this time.
0 commit comments