Skip to content

Commit 0d4d017

Browse files
Reduce Logfire log noise for cleaner observability (#60)
- Remove explicit SQLAlchemy instrumentation from database.py - Add uninstrument() call to prevent auto-instrumentation of pg_catalog queries - Remove redundant "Starting..." and "...completed" info logs from Modal functions - Keep useful early-return logs like "Simulation already completed" - Clean up force_flush() placement in economy functions
1 parent b87ffd0 commit 0d4d017

File tree

3 files changed

+607
-571
lines changed

3 files changed

+607
-571
lines changed

src/policyengine_api/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ def _scrubbing_callback(m: logfire.ScrubMatch):
3535
)
3636
logfire.instrument_httpx()
3737

38+
# Disable noisy SQLAlchemy auto-instrumentation
39+
try:
40+
from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
41+
42+
SQLAlchemyInstrumentor().uninstrument()
43+
except ImportError:
44+
pass # Not installed
45+
3846

3947
@asynccontextmanager
4048
async def lifespan(app: FastAPI):

0 commit comments

Comments
 (0)