mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: implement backend observability with logfire
This commit is contained in:
parent
ae63f56645
commit
67ac0b9d67
3 changed files with 74 additions and 20 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import uvicorn
|
||||
import logfire
|
||||
from fastapi import FastAPI, Request
|
||||
from config.config import LearnHouseConfig, get_learnhouse_config
|
||||
from src.core.events.events import shutdown_app, startup_app
|
||||
|
|
@ -38,6 +39,9 @@ app.add_middleware(
|
|||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
logfire.configure(console=False, service_name=learnhouse_config.site_name,)
|
||||
logfire.instrument_fastapi(app)
|
||||
|
||||
# Gzip Middleware (will add brotli later)
|
||||
app.add_middleware(GZipMiddleware, minimum_size=1000)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue