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 logging
|
||||
import logfire
|
||||
import os
|
||||
import importlib
|
||||
from config.config import get_learnhouse_config
|
||||
|
|
@ -39,6 +40,7 @@ engine = create_engine(
|
|||
|
||||
# Create all tables after importing all models
|
||||
SQLModel.metadata.create_all(engine)
|
||||
logfire.instrument_sqlalchemy(engine=engine)
|
||||
|
||||
async def connect_to_db(app: FastAPI):
|
||||
app.db_engine = engine # type: ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue