grafana / timestream-datasource

Amazon Timestream in Grafana
https://grafana.com/grafana/plugins/grafana-timestream-datasource
Apache License 2.0
23 stars 19 forks source link

Bugfix: Fix $interval variable interpolation #291

Closed idastambuk closed 2 months ago

idastambuk commented 2 months ago

We had a bug reported with Timestream panels in the new scenes architecture. More specifically when using the $interval_ms variable, which throws an error e.map is not a function

The reason for this is that is now interpolated on the frontend and comes to applyTemplateVariable in the number form, and not string as the Timestream applyTemplateVariables function expects. More info in this thread: https://raintank-corp.slack.com/archives/C03MCTKAJA0/p1719854820508569?thread_ts=1719433702.730869&cid=C03MCTKAJA0

To fix this, interval variables were replaced back to the string form to be handled on the backend, as before. This follows the approach other datasources have taken, e.g. https://github.com/grafana/grafana/pull/79645 Also, had to update grafana dependencies, cause types.

To reproduce the bug:

  1. make sure dashboardScene toggle is enabled
  2. Create a Timestream panel in a dashboard and enter query SELECT $__interval_ms AS test FROM "grafanaDB"."DevOps" LIMIT 10
  3. Go to Query Options and edit Max data points, for example. This will fill out the $__interval_ms variable
  4. Run the query and notice the error
SundayPowerEndre commented 1 month ago

https://github.com/grafana/grafana/issues/90434

We are stilling experiencing an issue that feels like it might be related to this?

We did not initally find this issue, so we had created a seperate ticket.