grafana/grafana-json-datasource

Grafana v9 - Button

AlexisGeorges1 opened this issue · 2 comments

What I am trying to do

Use grafana json plugin with grafana button plugin in order to interact with backend service.

Current behavior

  • The JSON plugin (version 1.3.8 compatible with Grafana >= 8.5.13) is currently forwarding request from api/datasources/proxy/4/...endpoint...to...call... to the configured datasource with ...endpoint...to...call... path.

  • The BUTTON plugin (version 0.3.2 compatible with Grafana >= 9.1.2) is querying (method POST) the configured datasource with such path /api/ds/query with endpoint to call in its body.

The json plugin is not handling queries on /api/ds/query path even if it seems to be the recommended approach.

What I am expecting

The json plugin should be able to forward requests from /api/ds/query path as Grafana built-in plugins.

Why not using another plugins?

  • Using Canvas -> Button : still marked as beta feature and not handling authentification (issue)
  • Using Button Plugin -> Don't keep authentification safely.
  • The button plugin selected is the only one using datasources which are responsible of sensitive credentials.

Additional information

  • In all case, the json plugin will need an update to be compatible with Grafana v9 even if Grafana Labs Team decide to not handle /api/ds/query. Indeed, the path api/datasources/proxy/datasourceID is marked as deprecated and will be removed. The new path is api/datasources/proxy/datasourceUID (documentation).

Warning: This API is deprecated since Grafana v9.0.0 and will be removed in a future release. Refer to the API for getting a single data source by UID or to the API for getting a single data source by its name.


Other issues mentioning Grafana deprecated API endpoints

I noticed the URL that your request is being sent to (api/datasources/proxy/4/test) is a deprecated API endpoint.
I wonder whether the plugin needs to be updated to use the newer /api/datasources/proxy/uid/:uid/ endpoint to fix this issue.
Originally posted by @mrferris in #304 (comment)

  1. grafana/grafana#59734 (comment)

Other issues mentioning Buttons

I see! The goal of this plugin is to read and visualize data from a JSON endpoint. I think what you're describing might be out of scope for this plugin.
Have you considered using the Button Panel for this?
Originally posted by @marcusolsson in #26 (comment)

Hiya. This is not the intended use case we want to support. Also the JSON plugin is frontend only plugin which is bit different from backend plugin. I would suggest infinity plugin instead which supports backend operations.