feat(telemetry): export admission_control.limit metric#4147
feat(telemetry): export admission_control.limit metric#4147
Conversation
The limit (configured capacity) is already present in the telemetry metadata of the :acquire event; add a last_value metric that reads it so dashboards can plot fill percentage (acquire.current / limit) per kind. Closes electric-sql/stratovolt#1471 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4147 +/- ##
==========================================
- Coverage 89.20% 85.37% -3.84%
==========================================
Files 25 40 +15
Lines 2520 3077 +557
Branches 636 641 +5
==========================================
+ Hits 2248 2627 +379
- Misses 270 448 +178
Partials 2 2
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:
|
Claude Code ReviewSummaryThis iteration moves What's Working Well
Issues FoundSuggestions (Nice to Have)No tests for the new metric definitions Neither Issue ConformanceNo linked issue is directly accessible (private repo), but the PR description clearly explains the motivation (fill-percentage dashboards, stratovolt#1471) and the implementation matches it completely. Previous Review Status
Review iteration: 3 | 2026-04-21 |
Keep the exported metric name aligned with the event it reads from, matching the convention used by the other admission_control metrics. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move limit from event metadata into measurements in admission_control :telemetry.execute/3 calls for both :acquire and :reject events. - Export electric.admission_control.acquire.limit and reject.limit via plain-atom last_value metrics (no 2-arity measurement function needed). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
limitfrom event metadata into measurements inElectric.AdmissionControlfor both[:electric, :admission_control, :acquire]and[:electric, :admission_control, :reject]events.last_valuemetrics tagged by:kindinStackTelemetry:electric.admission_control.acquire.limitelectric.admission_control.reject.limitacquire.current, the "Electric — Admission Control" dashboard (stratovolt#1467) can plot fill percentage =acquire.current / acquire.limitper kind.Closes electric-sql/stratovolt#1471
Test plan
mix testinpackages/electric-telemetry(99 tests pass)mix test test/electric/admission_control_test.exsinpackages/sync-service(11 tests pass)electric.admission_control.acquire.limitandelectric.admission_control.reject.limitcolumns appear in theadmin-electric/electric-regiondatasets on Honeycomb after deploy🤖 Generated with Claude Code