Skip to content

Commit

Permalink
issue-83: cleanup a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryk-dk committed Oct 31, 2024
1 parent 5425e18 commit 5e14137
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"webpack-livereload-plugin": "^3.0.2"
},
"engines": {
"node": ">=15"
"node": ">=20"
},
"dependencies": {
"@emotion/css": "11.11.2",
Expand Down
11 changes: 11 additions & 0 deletions pkg/plugin/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export class VictoriaLogsDatasource
};

if (fixedRequest.liveStreaming) {
console.log('Running live query through backend');
return this.runLiveQueryThroughBackend(fixedRequest);
}

Expand Down

0 comments on commit 5e14137

Please sign in to comment.