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

RedisJSON path fails to display non-string data #283

Closed
willtoth opened this issue Jan 1, 2023 · 1 comment · Fixed by #301
Closed

RedisJSON path fails to display non-string data #283

willtoth opened this issue Jan 1, 2023 · 1 comment · Fixed by #301

Comments

@willtoth
Copy link

willtoth commented Jan 1, 2023

Describe the bug

When pulling data from a RedisJSON data source using GET with a path, I can get data that is represented as a string, but not numeric data.

For example, on the command line I can run these queries:

127.0.0.1:6379> JSON.GET statbotics:matches:2022txfor_qm20 $.event
"[\"2022txfor\"]"
127.0.0.1:6379> JSON.GET statbotics:matches:2022txfor_qm20 $.year
"[2022]"

When I try these same queries in grafana I get the following results. First with the event key, which works as expected:

image

Next with the year key. You can see that it does not fail, as a failed query shows an error, however there is no data shown.

image

Version

2.1.1

Steps to reproduce

  1. Attempt to pull a RedisJSON field using JSON.GET on a path where the data is represented as a numeric value.

Additional context

Storing everything as a string instead technically works, but requires transformations, which makes things messier, especially since most queries are going to be on numeric values.

@slorello89
Copy link
Contributor

Yeah looks like this happens pretty much to any path that doesn't resolve to a single scalar string, or a direct string->string table. This will be a bit interesting though because JSON is by its nature is schemaless so regardless of what we do there's going to be some capacity for user error - I think we can safely cover the scalar cases if nothing else (numbers/strings/booleans)

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

Successfully merging a pull request may close this issue.

2 participants