diff --git a/Makefile b/Makefile index a8523b9..b026c3c 100644 --- a/Makefile +++ b/Makefile @@ -57,14 +57,13 @@ app-via-docker-windows-amd64: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(MAKE) app-via-docker-windows-goarch victorialogs-backend-plugin-build: \ - victorialogs-backend-plugin-amd64-prod -# victorialogs-backend-plugin-arm64-prod -# victorialogs-backend-plugin-linux-amd64-prod \ -# victorialogs-backend-plugin-linux-arm-prod \ -# victorialogs-backend-plugin-linux-arm64-prod \ -# victorialogs-backend-plugin-linux-386-prod \ -# victorialogs-backend-plugin-arm64-prod \ -# victorialogs-backend-plugin-windows-prod + victorialogs-backend-plugin-amd64-prod \ + victorialogs-backend-plugin-linux-amd64-prod \ + victorialogs-backend-plugin-linux-arm-prod \ + victorialogs-backend-plugin-linux-arm64-prod \ + victorialogs-backend-plugin-linux-386-prod \ + victorialogs-backend-plugin-arm64-prod \ + victorialogs-backend-plugin-windows-prod victorialogs-frontend-plugin-build: \ frontend-build diff --git a/package.json b/package.json index 5f59836..c6260f8 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "webpack-livereload-plugin": "^3.0.2" }, "engines": { - "node": ">=15" + "node": ">=20" }, "dependencies": { "@emotion/css": "11.11.2", diff --git a/pkg/plugin/datasource.go b/pkg/plugin/datasource.go index 133c799..e06326e 100644 --- a/pkg/plugin/datasource.go +++ b/pkg/plugin/datasource.go @@ -56,18 +56,29 @@ type Datasource struct { streamCh chan *data.Frame } +// SubscribeStream called when a user tries to subscribe to a plugin/datasource +// managed channel path – thus plugin can check subscribe permissions and communicate +// options with Grafana Core. As soon as first subscriber joins channel RunStream +// will be called. func (d *Datasource) SubscribeStream(ctx context.Context, request *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error) { return &backend.SubscribeStreamResponse{ Status: backend.SubscribeStreamStatusOK, }, nil } +// PublishStream called when a user tries to publish to a plugin/datasource +// managed channel path. func (d *Datasource) PublishStream(ctx context.Context, request *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error) { return &backend.PublishStreamResponse{ Status: backend.PublishStreamStatusPermissionDenied, }, nil } +// RunStream will be +// called once for the first client successfully subscribed to a channel path. +// When Grafana detects that there are no longer any subscribers inside a channel, +// the call will be terminated until next active subscriber appears. Call termination +// can happen with a delay. func (d *Datasource) RunStream(ctx context.Context, request *backend.RunStreamRequest, sender *backend.StreamSender) error { go func() { diff --git a/src/datasource.ts b/src/datasource.ts index 56d1fd3..807811e 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -92,7 +92,6 @@ export class VictoriaLogsDatasource }; if (fixedRequest.liveStreaming) { - console.log('Running live query through backend'); return this.runLiveQueryThroughBackend(fixedRequest); }