Closed xnyo closed 2 years ago
Aftertought: The current code changes are only for the datasource-basic
example. We have another backend-based example (datasource-http-backend
).
Shall we update that one as well to demonstrate how to use the status field? If not, I think we should at least bump grafana-plugin-sdk-go
in that example.
What do you think?
Aftertought: The current code changes are only for the
datasource-basic
example. We have another backend-based example (datasource-http-backend
). Shall we update that one as well to demonstrate how to use the status field? If not, I think we should at least bumpgrafana-plugin-sdk-go
in that example. What do you think?
🥇 I think that's a good idea!
This PR changes the
datasource-basic
example to demonstrate how to return a custom status code from aQueryData
request. In order to use this feature,github.com/grafana/grafana-plugin-sdk-go
has to be updated to at least v0.142.0 in the plugin. The status code is not currently being displayed anywhere in the Grafana UI, so the only way to test this is through the inspect panel.If using this plugin with an old version of Grafana that does not support 207 status code (e.g.: v9.2.4), the status code won't be present in the response. The error message however will be present as always.
Fixes #108.