Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FT.SEARCH and FT.AGGREGATE #292

Open
kefahi opened this issue Apr 7, 2023 · 1 comment
Open

Add support for FT.SEARCH and FT.AGGREGATE #292

kefahi opened this issue Apr 7, 2023 · 1 comment

Comments

@kefahi
Copy link

kefahi commented Apr 7, 2023

Is your enhancement related to a problem? Please describe.

RediSearch is a major source of information. In the current grafana plugin we only see support for FT.INFO which provides some statistics about the redisearch index. But the user is unable to extract actual data from the redisearch index and use it in grafana. this is a major limitation.

Describe the solution you'd like

Add two more options to Grafana redis under redisearch: FT.SEARCH and FT.AGGREGATE. Where the result of those calls will simply be formatted as a simple json to be then processed by grafana. e.g. FT.SEARCH retuns document id and body; the result can be rendered as [{id: doc_id, body: doc_body}, ...].
Similar approach can be used with FT.AGGREGATE as well; but the keys and their values can be constructed dynamically from the response provided by redis.

I inspected the PR that added FT.INFO support ...

We need to extend the code in this file : pkg/redis-search.go
And introduce the description for the new redisearch commands in those files : pkg/query.go and src/redis/command.ts

Describe alternatives you've considered

I tried running redis commnand line to achieve the goal, but due to how redis returns the data (a single sequential array for name,value,name,value,name,value) it is not possible -as per my understanding- to format the results in a way that can be further consumed by a grafana transformer.

@slorello89
Copy link
Contributor

Hey @kefahi - Adding FT.SEARCH in #297 - Aggregate might be a bit more complicated because of how dynamic the arguments are but I'm pretty sure we'll be able to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants