feat: split shape count by indexability#4125
Conversation
Claude Code ReviewSummaryThe PR is in excellent shape. Since the previous review, the last remaining suggestion (the What's Working Well
Issues FoundSuggestions (Nice to Have)
File: This function iterates every shape in SQLite via
Issue ConformanceNo linked issue, but the PR description is thorough and the implementation matches it exactly. Operational telemetry with no observable behavior change for clients. Previous Review StatusAll items resolved:
One open question remains: the tracing visibility of Review iteration: 3 | 2026-04-15 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4125 +/- ##
=======================================
Coverage 89.20% 89.20%
=======================================
Files 25 25
Lines 2520 2520
Branches 641 638 -3
=======================================
Hits 2248 2248
Misses 270 270
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:
|
5c6e7b6 to
da236bd
Compare
| :ok | ||
| end | ||
|
|
||
| defp rebuild_shape_routing_state(stack_id) do |
There was a problem hiding this comment.
What is the performance of going through all shapes in shapedb? Is it trivial enough for, say, 100k shapes, such that we don't need to add a tracing span around it for visibility?
da236bd to
f9fb78b
Compare
Summary
Add sync-service telemetry for indexed vs unindexed shape counts so we can correlate stack behavior with how shapes are routed in
ShapeLogCollector.Motivation
Some stacks have very large shape cardinality, and total shape count alone does not explain routing cost well enough. Splitting shapes by indexability makes it easier to understand when work is dominated by indexed routing versus
other_shapesscans.Implementation
electric.shapes.indexed_shapes.countelectric.shapes.unindexed_shapes.countShapeStatusand emit all three shape metrics (total,indexed,unindexed) from one O(1) snapshot rather than scanning shapes during each telemetry tickVerification
total/indexed/unindexed/activemetricsNo linked issue; this change is operational telemetry to improve observability for large stacks.