Move expiring-shapes log counts into Logger metadata#4161
Move expiring-shapes log counts into Logger metadata#4161erik-the-implementer wants to merge 1 commit intomainfrom
Conversation
Keep the "Expiring shapes as the number of shapes has exceeded the limit" notice body static and move the dynamic counts into Logger metadata. This allows log aggregators to group these events and lets Honeycomb filter by the new shape.expiry.* OTEL attributes. Refs electric-sql/alco-agent-tasks#33
Claude Code ReviewSummaryThis PR converts the expiring-shapes What's Working Well
Issues FoundCritical (Must Fix)None. Important (Should Fix)None. Suggestions (Nice to Have)
Issue ConformanceThe PR references Review iteration: 1 | 2026-04-24 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4161 +/- ##
=======================================
Coverage 68.08% 68.08%
=======================================
Files 130 130
Lines 16211 16211
Branches 3912 3911 -1
=======================================
Hits 11037 11037
Misses 5170 5170
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Replace the interpolated
number_to_expire/max_shapesvalues in theLogger.notice(\"Expiring #{n} shapes as the number of shapes has exceeded the limit (#{max})\")call with a static message plus those values as structured Logger metadata. Extends the OTEL log handler'smetadata_mapso the counts surface asshape.expiry.number_to_expireandshape.expiry.max_shapesattributes.Why
The expiring-shapes notice fires frequently and every entry currently contains different counts, which prevents log aggregators from grouping them together and makes filtering/aggregation in Honeycomb awkward. Following the pattern in #4145, keeping the message text static (with the dynamic values exported as attributes) makes these events easier to search, group, and alert on.
Refs electric-sql/alco-agent-tasks#33.
Test plan
mix compile --warnings-as-errorspasses inpackages/sync-service