Skip to content

No HTTP handler reports AggregationMetrics, so the TimeSeries read-path counters are invisible in production #7717

Closed

Description

@robfrank

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=true block in the JSON response is cheaper and matches what EXPLAIN already 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 null must stay legal and allocation-free on the paths that do not want counters.

Activity

  1. added
    server
    timeseries
    observability
    on Sep 16, 2026
  2. added
    enhancement
    on Sep 16, 2026
  3. added this to the 26.10.1 milestone on Sep 16, 2026
  4. added
    in progress
    on Sep 16, 2026
  5. self-assigned this
    on Sep 16, 2026
  6. added 8 commits that reference this issue on Sep 16, 2026
  7. lvca commented on Sep 16, 2026

    @lvca
    Member

    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, type and surface (which endpoint made the read):

    Meter What it counts
    arcadedb.timeseries.read.blocks compacted blocks skipped, answered from their summary, or read in full (outcome tag)
    arcadedb.timeseries.read.pages recent-data pages scanned or skipped (outcome tag)
    arcadedb.timeseries.read.rows rows actually materialised
    arcadedb.timeseries.read.overflow.buckets buckets that fell outside the pre-sized window
    arcadedb.timeseries.read.phase time spent reading, decompressing and accumulating (phase tag)

    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 /ts read path - query, latest, the Grafana route, the PromQL routes - and the gRPC equivalents. Requires arcadedb.server.metrics to 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.

  8. removed
    in progress
    on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementobservabilityservertimeseries

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions