Conversation
Gauges already split multi-node resources on ordinal. Counters such as dedicated-database inbound, outbound and compute need the same column so a chart can tell members apart. setup() adds it to existing event tables. The daily MV stays grouped on resource identity only, so billing still sums every member. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Resolve Metric::getEventIndexes against the skip-index and prefixed-index changes that landed on main, keeping ordinal in the set(0) index list. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Summary
ordinaltoEVENT_COLUMNS, the event schema, and event indexes so additive counters (dedicated-database inbound / outbound / compute) can split per member the way gauges already do.setup()ADD COLUMN IF NOT EXISTSs it onto existing event tables. The daily MV stays grouped on resource identity only, so a billing sum without an ordinal filter still totals every member.ordinalbecomes a shared dimension rather than a gauge-only one, soMetricTest::testOrdinalIsGaugeOnlyis replaced by a case asserting it appears in bothGAUGE_COLUMNSandEVENT_COLUMNSwith an index on each.Test plan
tests/Usage/MetricTest.phpandClickHouseColumnTypeTest.php(56 tests)testEventOrdinalSeparatesReplicaSeriesagainst ClickHouse (filter/groupBy/ unsplitsum) — the Tests workflow runs the whole suite insidedocker composeagainst a realclickhouse/clickhouse-server:25.11-alpine, and it is green on this head: OK (379 tests, 1736 assertions), run 35674840031main:Metric.php,ClickHouse.phpandMetricTest.phphad taken five schema commits since this branch was cut (skip indexes, low-cardinality request dimensions,ipReputation), all absorbed by the merge in 302a204Notes
Metric.phpandClickHouse.phpregions; whichever lands second will need a merge.Made with Cursor