Compare commits

...

2 Commits

Author SHA1 Message Date
Nicholas Tindle
d58df37238 Merge branch 'dev' into fix/sentry-performance-integrations 2026-02-04 21:32:12 -06:00
Otto
9c41512944 feat(backend): Add Sentry FastAPI and HTTPX integrations for better performance tracing
Adds FastApiIntegration and HttpxIntegration to Sentry SDK initialization to enable:
- Detailed span tracking for FastAPI request handling
- Automatic tracing of outgoing HTTP calls (OpenAI, external APIs, etc.)

This improves visibility in Sentry Performance for debugging slow requests and identifying bottlenecks in external API calls.
2026-02-04 22:47:35 +00:00

View File

@@ -6,6 +6,8 @@ from pydantic import SecretStr
from sentry_sdk.integrations import DidNotEnable from sentry_sdk.integrations import DidNotEnable
from sentry_sdk.integrations.anthropic import AnthropicIntegration from sentry_sdk.integrations.anthropic import AnthropicIntegration
from sentry_sdk.integrations.asyncio import AsyncioIntegration from sentry_sdk.integrations.asyncio import AsyncioIntegration
from sentry_sdk.integrations.fastapi import FastApiIntegration
from sentry_sdk.integrations.httpx import HttpxIntegration
from sentry_sdk.integrations.launchdarkly import LaunchDarklyIntegration from sentry_sdk.integrations.launchdarkly import LaunchDarklyIntegration
from sentry_sdk.integrations.logging import LoggingIntegration from sentry_sdk.integrations.logging import LoggingIntegration
@@ -37,6 +39,8 @@ def sentry_init():
_experiments={"enable_logs": True}, _experiments={"enable_logs": True},
integrations=[ integrations=[
AsyncioIntegration(), AsyncioIntegration(),
FastApiIntegration(), # Traces FastAPI requests with detailed spans
HttpxIntegration(), # Traces outgoing HTTP calls (OpenAI, external APIs)
LoggingIntegration(sentry_logs_level=logging.INFO), LoggingIntegration(sentry_logs_level=logging.INFO),
AnthropicIntegration( AnthropicIntegration(
include_prompts=False, include_prompts=False,