RedisGrafana / grafana-redis-explorer

Redis Explorer for @grafana allows connecting to Redis Enterprise software clusters using REST API.
https://redisgrafana.github.io
Apache License 2.0
6 stars 0 forks source link

Update Redis Enterprise datasource in response to breaking changes in Grafana 10.0.0 #75

Open YayBurritos opened 11 months ago

YayBurritos commented 11 months ago

Describe the bug

The Redis Enterprise datasource (src/redis-enterprise-software-datasource/datasource/datasource.ts) as of the current version (2.1.1) has calls to arrayFrame.setFieldType(...), which uses the ArrayDataFrame from @grafana/data.

It appears that of this commit (https://github.com/grafana/grafana/commit/8352e716ddac2779b9e38fb766cbcfcd67ee90d3#diff-31ea53551a1d70d58477462af69f7c935037968c7d4bd1fd611365bdeca21f36), the setFieldType function was removed (among other potentially breaking changes).

Users with newer versions of Grafana (10.0.0 perhaps - see https://github.com/grafana/grafana/pull/67427) are unable to use the Redis Enterprise datasource.

Version

2.1.1

Steps to reproduce

  1. Grafana 10.0.0+
  2. Redis Enterprise datasource 2.1.1 installed and configured to point to your Redis cluster
  3. In Grafana, go to Explore and select the Redis Enterprise datasource
  4. Within the datasource, specify Type: Database
  5. Click Run

Observe the query error: p.setFieldType is not a function.

NOTE: This is just one example of where this same error might appear.

Expected behavior

The datasource is able to connect to the Redis cluster and return the requested data without encountering a TypeScript error.

Screenshots

redis-enterprise-datasource-ts-error
slorello89 commented 11 months ago

Hi @YayBurritos - thanks for pointing this out, looks like you are 100% right, https://github.com/grafana/grafana/pull/67427 was a major compatibility break and will likely force this plugin to be upgraded to use the Grafana 10 SDKs/build framework.

Is this a major blocker for you?

YayBurritos commented 11 months ago

Hey @slorello89! Thanks for reaching out. This isn't a blocker for us at the moment. More of a nice-to-have. We're planning to try to scrape the Redis metrics with Prometheus and then get similar dashboards in place using those metrics. Not sure how they'll compare to what we have with the Redis Enterprise datasource and related dashboards, but I'd expect it to be somewhat similar.

Thanks!