-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming via PI WebAPI websocket #99
Comments
I took a rough look at this (ee7dbda), and I think the improvements are are not offsetting the significant issues it comes with. The biggest challenge is that it only makes sense with the Access parameter set to "Browser" at the moment. The "Server" option has no way to proxy the websocket connection using your grafana server, and the websocket needs to be opened directly from your browser. Without trying to speak for the developer team, I think this function would make more sense if the plugin was updated with a backend server component. |
Actually, I was wrong. You can pass the websocket traffic through the proxy like this: 5c27572. |
Thank you so much for looking into this so quickly. Sounds like maybe there's a way forward on this? If I can help in any way, please let me know. I can check out your commit and see if I can find any issues. |
One additional thing we would want to do besides connecting the websocket with the "includeIntitialValues" flag is to do a simple query first to determine size of the CircularDataFrame and to fill the CircularDataFrame with back data from the dashboard date range (say, for instance that the dashboard showed the last few hours to now). Then, any additional data that comes in on the websocket would be added to the CircularDataFrame if it falls inside the date range. I can confirm with the "Live Measurements" Grafana streaming demo data source that the CircularDataFrame is indeed...circular. The data rolls when date range is set to "last x minutes". Makes perfect sense, and shouldn't really confuse users. It's an open question if we would want to have the UI include an option to "Use websocket", or just make it do that automatically, as I can't really think of a downside, unless that feature is explicitely blocked or turned off for a particular user on their WebAPI server This would be a very good add for our industry (power) as some data is updated as often as every 4s or less, and would greatly reduce the load on the WebAPI servers when users want to view real-time data in near real-time (which would, without this feature, mean they would have to query the server every few seconds, with all the round-trip and querying overhead). |
Does the plugin currently have the ability to stream data via WebAPI Websocket? It would be very valuable to have a streaming connection to get real-time updates from PI server, and could be more timely, efficient, and easier on the server than polling. This would fall into the feature request category if it is not currently supported.
Relevant documentation from Grafana:
https://grafana.com/docs/grafana/latest/developers/plugins/build-a-streaming-data-source-plugin/
Documentation on channels can be found in the PI WebAPI built-in documenation at /piwebapi/help/topics/channels.
The text was updated successfully, but these errors were encountered: