Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from app.utils import generate_email_map
from app.email import send_email
from dotenv import load_dotenv
from sentry_sdk.integrations.logging import LoggingIntegration


@asynccontextmanager
Expand All @@ -25,6 +26,23 @@ async def lifespan(app: FastAPI):
app = FastAPI(lifespan=lifespan)


# Setup sentry logging
sentry_logging = LoggingIntegration(
level=logging.INFO, # Capture info and above as breadcrumbs
event_level=logging.ERROR # Send errors as events
)
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
integrations=[
sentry_logging,
],

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production,
traces_sample_rate=1.0,
)

class Email(BaseModel):
email_address: str

Expand Down