feat: add sentry logging (optional) (#2172)

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2024-12-05 16:07:34 -08:00
committed by GitHub
parent b3a7056c5d
commit 8c0aa76c4f
3 changed files with 104 additions and 110 deletions

View File

@@ -124,6 +124,17 @@ def create_application() -> "FastAPI":
# server = SyncServer(default_interface_factory=lambda: interface())
print(f"\n[[ Letta server // v{__version__} ]]")
if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
import sentry_sdk
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
traces_sample_rate=1.0,
_experiments={
"continuous_profiling_auto_start": True,
},
)
app = FastAPI(
swagger_ui_parameters={"docExpansion": "none"},
# openapi_tags=TAGS_METADATA,