Skip to content

Conversation

@nikhilwoodruff
Copy link
Contributor

Logs were flooded with internal SQLAlchemy metadata queries (SELECT pg_catalog...) and redundant start/complete messages, making it hard to see what was actually happening.

Changes:

  • Remove explicit logfire.instrument_sqlalchemy() from database.py
  • Add SQLAlchemyInstrumentor().uninstrument() to prevent auto-instrumentation
  • Remove redundant logfire.info calls from Modal functions (spans already capture this)
  • Keep useful early-return logs like "Simulation already completed"
  • Fix force_flush() placement to ensure spans are properly closed before flushing

The result is much cleaner logs that show meaningful application-level spans rather than internal database chatter.

- 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
@nikhilwoodruff nikhilwoodruff merged commit 0d4d017 into main Jan 1, 2026
1 check passed
@nikhilwoodruff nikhilwoodruff deleted the cleanup-logfire-noise branch January 1, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants