grafanaplugin icon indicating copy to clipboard operation
grafanaplugin copied to clipboard

Feature request: Move implementation to the backend to support enterprise query caching

Open marefr opened this issue 2 years ago • 1 comments

Currently the datasource has one implementation client side that uses the Grafana datasource proxy, i.e. http://<host>/api/datasources/proxy/<ds identifier>/sql to fetch data. It also has a backend implementation which seems to only be used for supporting Grafana Alerting. Grafana also had this setup for built-in datasources, but most have now migrated to use the backend implementation from client side, i.e. /api/ds/query, and for Grafana Alerting.

Some customers have raised concerns regarding performance and loading a lot of data using this datasource and would like to be able to use Grafana Enterprise Query Caching, but it's currently not supported.

By making your datasource extend the DataSourceWithBackend instead of DataSourceApi it will support Grafana Enterprise Query Caching. Using DataSourceWithBackend will out of the box use /api/ds/query to fetch data, see example.

marefr avatar Mar 14 '23 10:03 marefr

Thanks for your advice. We use DataSourceWithBackend api from the beginning. Front-end dashboard queries will request back-end plugins. But there will be performance issues when there are too many queries on the front-end dashboard. If there are too many query requests, the plug-in will report a 503 error when processing. So we now use the front-end implementation to handle front-end dashboard requests.

We will try DataSourceWithBackend again in the future

sunpe avatar Mar 15 '23 01:03 sunpe