feat(time-series): add TS.QUERYLABELS (LABELS and VALUES forms)#3354
Open
nkaradzhov wants to merge 1 commit into
Open
feat(time-series): add TS.QUERYLABELS (LABELS and VALUES forms)#3354nkaradzhov wants to merge 1 commit into
nkaradzhov wants to merge 1 commit into
Conversation
Add client support for TS.QUERYLABELS, introduced in RedisTimeSeries 8.10. The command returns label metadata for time series matching a filter: the set of all label names (LABELS), or the set of all values of one label name (VALUES label). It completes the drill-down flow alongside TS.QUERYINDEX. Two methods are exposed so the mandatory label argument of the VALUES form is enforced by the signature: - queryLabels(filter?) -> TS.QUERYLABELS LABELS [FILTER ...] - queryLabelValues(label, filter?) -> TS.QUERYLABELS VALUES label [FILTER ...] The command is keyless and read-only; FILTER is optional in both forms and omitting it queries all indexed series. Filter expressions reuse the existing TS.QUERYINDEX representation and are sent verbatim. The reply is a flat array under RESP2 and a set under RESP3; an empty reply is a valid success. Not eligible for client-side caching (server advertises the dont_cache tip). Passing an explicitly empty filter array raises a local usage error rather than silently widening to all series. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds client support for
TS.QUERYLABELS, introduced in RedisTimeSeries 8.10. The command returns label metadata for time series matching a filter: the set of all label names (LABELS), or the set of all values of one label name (VALUES label). It completes the Grafana-style drill-down flow alongside the existingTS.QUERYINDEX.Two methods are exposed so the mandatory
labelargument of theVALUESform is enforced by the signature:client.ts.queryLabels(filter?)→TS.QUERYLABELS LABELS [FILTER ...]client.ts.queryLabelValues(label, filter?)→TS.QUERYLABELS VALUES label [FILTER ...]The command is keyless and read-only; in cluster mode the receiving shard performs the cluster-wide fan-out and returns a single merged, deduplicated reply, so clients use default keyless routing with no client-side aggregation. Filter expressions reuse the existing
TS.QUERYINDEXfilter representation and are sent verbatim (not parsed, reordered, or deduplicated). The reply is a flat array under RESP2 and a set under RESP3; an empty reply is a valid success.Behavior notes:
FILTERis optional in both forms; omitting it queries all indexed series.FILTERtoken is rejected by the server).dont_cachetip).New
QUERYLABELS.ts/QUERYLABELS_VALUES.ts(+ co-located specs), a sharedparseQueryLabelsFilterArgumenthelper inhelpers.ts, and registry entries with JSDoc incommands/index.ts.🤖 Generated with Claude Code
Note
Low Risk
Additive read-only command bindings and tests only; no changes to existing command behavior.
Overview
Adds client support for RedisTimeSeries 8.10
TS.QUERYLABELS, exposingqueryLabels(filter?)(LABELS— distinct label names) andqueryLabelValues(label, filter?)(VALUES— distinct values for one label). Both are keyless, read-only commands with RESP2 array / RESP3 set replies, matching the existingQUERYINDEXpattern.Optional filters reuse the same expression style as
TS.QUERYINDEXand are appended via a new sharedparseQueryLabelsFilterArgumenthelper; an explicitly empty filter array throws locally instead of widening to all series. Registry entries and integration tests cover argument encoding, filtered/unfiltered queries, empty results, and RESP2.Reviewed by Cursor Bugbot for commit c80d672. Bugbot is set up for automated code reviews on this repo. Configure here.