fix: ensure metric aliases are always exported#164
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesMetric Alias Scope Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR fixes a backend startup issue caused by
INGEST_COUNTERandREASONING_TRIGGER_COUNTERnot being consistently exported fromlibs/observability/metrics.py.The aliases were defined inside a nested conditional block, which meant they were not created on all execution paths. As a result, importing these metrics in
apps/backend/routes/ingest.pycould raise:This prevented the FastAPI backend from starting successfully.
Changes Made
INGEST_COUNTERandREASONING_TRIGGER_COUNTERare always available for import.Testing
Before
After
Verification
Related Issue
Fixes #156
Summary by CodeRabbit