Repository navigation
Description
Follow-up to #7660, which stopped GET /prom/api/v1/label/{name}/values scanning the samples by unioning each
sealed block's declared distinct tag values.
The gap
GetPromQLSeriesHandler is the other discovery endpoint and it was NOT fixed by that change, because the answer
it produces is a different shape:
$ grep -n 'forEachRow' server/src/main/java/com/arcadedb/server/http/handler/*.java
server/src/main/java/com/arcadedb/server/http/handler/GetPromQLSeriesHandler.java:145: engine.forEachRow(startMs, endMs, columnIndices, null, null, row -> {
It returns the distinct label COMBINATIONS a metric carries - one JSON object per {host, region, ...} tuple -
and nothing on disk records a tuple. BlockEntry.tagDistinctValues is per COLUMN
(engine/src/main/java/com/arcadedb/engine/timeseries/TimeSeriesSealedStore.java:162, "indexed by schema column
index"), so the cross product of two columns' declared sets over-counts: a block declaring
host in {h1, h2} and region in {eu, us} is consistent with two combinations or with four, and the entry
cannot say which.
So this endpoint still walks every sample of every matching type, exactly as label-values did before #7660, and
Grafana calls it on the same dashboard-load path.
Suggested work
Three options, in increasing cost:
- Record the distinct COMBINATIONS per block alongside the per-column sets, at seal time, capped - the tuple
cardinality of one block is bounded by its sample count but not by anything smaller, so an uncapped set is a
new way to blow up a block header. A cap turns the entry into a hint, and a block over the cap falls back to
the scan, the same shapecollectDistinctTagValuesalready uses for a block with no usable declaration. - Answer from the per-column sets when a block declares EVERY tag column as a single value - that block
contributes exactly one combination and needs no read at all.blockMatchesTagFilteralready computes that
condition for pruning (allSingleMatch), which is a common shape for Prometheus data where one block holds one
series. - Leave the scan and bound it: the endpoint has no limit, so a high-cardinality metric answers with everything.
Option 2 is the cheapest real win and needs no new on-disk state.
Verification
- Byte-identical response to the scanning implementation, including the ordering the handler documents (earliest
first-observed timestamp first). - A block holding more than one combination must not be answered from the per-column sets: the cross product is
the wrong answer and a test has to hold a block that proves it. - The
start/endbounds the endpoint already honours must keep being honoured.
Activity
fix(#7715,#7710): measure the exponent tripwire with StallAwareStopwa…
Merge main, and close the #7714 header sweep on the three vector-sear…
Merge main: keep the /series fast path, now counted by the read metrics
test(#7710,#7711): pin the mixed declaration, and why the undecodable…
refactor(#7710): one predicate for "this declaration is exact", not t…
Merge pull request #7730 from ArcadeData/fix/issue-7715-7714-7712-771…
lvca commentedon Sep 16, 2026
Fixed in #7730, released in 26.10.1.
GET /prom/api/v1/seriesno longer reads every sample to list which label combinations a metric has. Where a stored block holds a single series - the usual shape for Prometheus data - the answer is now taken from the block's own summary without reading it at all. Blocks that hold more than one combination, or that are only partly inside the requested time range, are read as before.The response is unchanged, ordering included; only the work behind it is smaller. This mainly helps Grafana dashboard loads, which call this endpoint on every refresh.
❤️ 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 #7710's combinations fast path and the #7733 widened…
fix(ArcadeData#7715,ArcadeData#7714,ArcadeData#7712,ArcadeData#7711,A…
address review: race the declared-combination fast path too, and impo…