hvoss-techfak commited on
Commit
a0e83f7
·
1 Parent(s): 651d505

sentry fastapi fix

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -3,7 +3,7 @@ import os, logging
3
  import sentry_sdk
4
  from sentry_sdk import capture_exception
5
  from sentry_sdk.integrations.logging import LoggingIntegration
6
-
7
  dsn = os.getenv("SENTRY_DSN")
8
  if not dsn:
9
  print("WARNING: SENTRY_DSN not set – Sentry disabled")
@@ -13,9 +13,10 @@ else:
13
  traces_sample_rate=0.1,
14
  integrations=[
15
  LoggingIntegration(
16
- level=logging.INFO, # breadcrumb level
17
  event_level=logging.ERROR,
18
  ),
 
19
  ],
20
  release=os.getenv("HF_SPACE_VERSION", "dev"),
21
  environment="hf_space",
 
3
  import sentry_sdk
4
  from sentry_sdk import capture_exception
5
  from sentry_sdk.integrations.logging import LoggingIntegration
6
+ from sentry_sdk.integrations.fastapi import FastApiIntegration
7
  dsn = os.getenv("SENTRY_DSN")
8
  if not dsn:
9
  print("WARNING: SENTRY_DSN not set – Sentry disabled")
 
13
  traces_sample_rate=0.1,
14
  integrations=[
15
  LoggingIntegration(
16
+ level=logging.INFO, # breadcrumb level
17
  event_level=logging.ERROR,
18
  ),
19
+ FastApiIntegration(),
20
  ],
21
  release=os.getenv("HF_SPACE_VERSION", "dev"),
22
  environment="hf_space",