Repository navigation
Description
Raised by the automated review on PR #7713 (#7660), generalised after checking where the counters actually go.
The gap
AggregationMetrics counts what a TimeSeries read actually did - blocks skipped, blocks taken on the fast or
slow path, mutable pages scanned or skipped, rows materialised, overflow buckets. Every engine read path takes
one as an optional parameter. Nothing on the HTTP surface ever passes one:
$ grep -rn "AggregationMetrics" --include=*.java server/src/main/java grpcw/src/main/java
(no output)
$ grep -rn "new AggregationMetrics(" --include=*.java . | grep -v /test/
engine/.../query/sql/executor/AggregateFromTimeSeriesStep.java:91: aggregationMetrics = new AggregationMetrics();
engine/.../engine/timeseries/TimeSeriesEngine.java:657: final AggregationMetrics shardMetrics = ... new AggregationMetrics() : null;
So the only production consumer is the SQL aggregation step. Every /ts/** handler - query, latest, the Grafana
routes, the Prometheus routes - passes null, and the counters exist only for tests to assert on.
The concrete case that raised it: #7713 made GET /prom/api/v1/label/{name}/values answer the sealed layer from
each block's declared distinct tag values rather than decompressing it, and counts a block answered that way as
skippedBlocks and a block it had to read as slowPathBlocks. Issue7660DistinctTagValuesFromBlockMetadataTest
asserts the ratio, but an operator cannot see it: whether the fast path is being hit for a given tenant's data -
or whether every block is falling back because the tag column is not a STRING, or because the blocks predate
the tag metadata section - is not observable at all.
Why it was not done in #7713
There is no pattern to follow. Wiring one handler to a sink would be inventing the convention rather than
applying it, and the choice of sink (Micrometer, the existing server metrics registry, a debug response field
behind a query parameter) is a decision for the /ts surface as a whole, not for one endpoint.
Suggested work
Pick the sink once and apply it across the /ts handlers:
- Micrometer counters/timers per type, alongside whatever the server already registers, is the option that
reaches a dashboard. - A
?debug=trueblock in the JSON response is cheaper and matches whatEXPLAINalready gives the SQL path,
but it is per-request and not aggregable.
Either way TimeSeriesEngine.forEachRow / query / aggregate / collectDistinctTagValues already accept the
parameter, so the engine side needs no change.
Verification
- A request against a type with sealed blocks reports a non-zero block count through the chosen sink, and the
numbers match what the engine tests already assert for the same shape of data. - Passing
nullmust stay legal and allocation-free on the paths that do not want counters.
Activity
fix(#7717): say what the read-metrics cache ceiling actually bounds
test(#7725, #7717): cover the gRPC wiring, which the engine and HTTP …
fix(#7717): count the two PromQL evaluation reads, the last /ts reads…
Merge branch 'main' into fix/issue-7725-7724-7722-7717-7716-batch
fix(#7717): count the mutable ascending scan, instead of documenting …
fix(#7717): count the aggregation's mutable half too, closing the las…
fix(#7717, #7716): count the Grafana raw branch, and stop a parse err…
Merge pull request #7728 from ArcadeData/fix/issue-7725-7724-7722-771…
lvca commentedon Sep 16, 2026
Implemented in #7728, released in 26.10.1.
TimeSeries reads now publish what they actually did, as Micrometer metrics alongside the ones the server already exposes (Prometheus, OTLP). Previously these counters existed internally but nothing reported them, so there was no way to see whether the read optimisations were helping your data.
New meters, tagged by
db,typeandsurface(which endpoint made the read):arcadedb.timeseries.read.blocksoutcometag)arcadedb.timeseries.read.pagesoutcometag)arcadedb.timeseries.read.rowsarcadedb.timeseries.read.overflow.bucketsarcadedb.timeseries.read.phasephasetag)The useful one to watch is the ratio of skipped to read blocks: a low ratio means queries are decompressing data they could have skipped.
Covers every
/tsread path - query, latest, the Grafana route, the PromQL routes - and the gRPC equivalents. Requiresarcadedb.server.metricsto be enabled; with metrics off nothing is collected and the read path is unchanged.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Merge main: keep the /series fast path, now counted by the read metrics
fix: batch of 5 TimeSeries read-path issues (ArcadeData#7725, ArcadeD…