support GraphQL subscriptions
Closes #57
I did not find any documentation if Grafana officially supports proxying websockets. For now only the Browser option supports websockets and therefor subscriptions.
This looks really nice, thanks! Subscriptions were on my "nice to have" long-term roadmap, I really appreciate you taking this on. Give me a few days to review all these changes.
Can you recommend a datasource to test this with? Otherwise I'll just implement subscriptions in the test datasource (which should support it regardless for demonstration).
Unfortunately I tested it locally on an internal Hasura server.
@SydoxX I'm really sorry it took so long for me to look at this. I finally added subscriptions to the test datasource, and have a couple immediate comments:
- I don't think it's a safe assumption that the subscription websockets endpoint is the same as the query endpoint. It's probably best to add a new configuration option, which could default to the same endpoint.
- Grafana does appear to proxy websockets, at least when looking at "live" Loki logs in Explore.
@SydoxX I'm really sorry it took so long for me to look at this. I finally added subscriptions to the test datasource, and have a couple immediate comments:
1. I don't think it's a safe assumption that the subscription websockets endpoint is the same as the query endpoint. It's probably best to add a new configuration option, which could default to the same endpoint. 2. Grafana does appear to proxy websockets, at least when looking at "live" Loki logs in Explore.
- Indeed, I'll add another config option.
- Thanks for the heads-up, I'll see if I can get proxied websockets working.
Added text field to enter websocket url and also added some info boxes about GraphQL subscriptions.
I updated grafana in the package.json to version 8.1.4 but unfortunately this results in an endless loop while executing npm install. But I suspect this is a problem on my side.