GridProtectionAlliance / osisoftpi-grafana

Grafana Data Source Plugin for the OSIsoft PI System
https://grafana.com/plugins/gridprotectionalliance-osisoftpi-datasource
Apache License 2.0
58 stars 30 forks source link

Support Public Dashboards #102

Closed kristwaa closed 1 year ago

kristwaa commented 1 year ago

Grafana has introduced Public Dashboards, which is still in alpha at the time of writing. The functionality was made available in August 2022.

Version 3.0.0 of the OSIsoft PI plugin doesn't work in our setup - it returns both HTTP 401 Unauthorized and HTTP 500 Internal Server Error when accessed through a Public Dasboard link. The plugin is configured to run on the server/through the proxy.
A simple dashboard with a single panel gave me this in the log:

msg="Error querying datasources for public dashboard" error="[plugin.unavailable] plugin unavailable" datasources=[gridprotectionalliance-osisoftpi-datasource]

Has anyone already looked into what is required to make this work?
Is it only an upgrade of the Grafana libs, or must some new functionality be implemented?

complacentsee commented 1 year ago

I believe this functionality only works for grafana plugins with a backend datasource component. I think the querying method is similar to how the alerting queries work. I have been playing with creating a backend component for this plugin, but it's just something I'm playing with at the moment.

kristwaa commented 1 year ago

Thanks for the feedback!

Looks like you're right. Just to check I updated the plugin to use the latest version of the Grafana libs, but that didn't help. Still getting the plugin unavailable error. I've never worked with the plugin before, so there is a chance I made mistakes - I did get some warnings when building.

Would that backend component be implemented in Go? It's unclear to me how much would have to change. Is it editing plugin.json and then implement the backend process? Would that roughly mean re-implementing datasource.ts?

coderReview commented 1 year ago

This is not going to be done at this moment. It needs a huge rebuild of the plugin by implementing it in Go language.