|
|
|
@ -18,7 +18,6 @@ import ( |
|
|
|
|
"github.com/grafana/grafana-plugin-sdk-go/data" |
|
|
|
|
"github.com/grafana/grafana/pkg/components/simplejson" |
|
|
|
|
"github.com/grafana/grafana/pkg/models" |
|
|
|
|
"github.com/grafana/grafana/pkg/plugins" |
|
|
|
|
"github.com/grafana/grafana/pkg/setting" |
|
|
|
|
"github.com/grafana/grafana/pkg/util/retryer" |
|
|
|
|
"golang.org/x/sync/errgroup" |
|
|
|
@ -111,7 +110,7 @@ func (r *logQueryRunner) publishResults(orgID int64, channelName string) error { |
|
|
|
|
//nolint: staticcheck // plugins.DataResponse deprecated
|
|
|
|
|
func (e *cloudWatchExecutor) executeLiveLogQuery(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { |
|
|
|
|
responseChannelName := uuid.New().String() |
|
|
|
|
responseChannel := make(chan plugins.DataResponse) |
|
|
|
|
responseChannel := make(chan *backend.QueryDataResponse) |
|
|
|
|
if err := e.logsService.AddResponseChannel("plugin/cloudwatch/"+responseChannelName, responseChannel); err != nil { |
|
|
|
|
close(responseChannel) |
|
|
|
|
return nil, err |
|
|
|
@ -135,7 +134,7 @@ func (e *cloudWatchExecutor) executeLiveLogQuery(ctx context.Context, req *backe |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//nolint: staticcheck // plugins.DataResponse deprecated
|
|
|
|
|
func (e *cloudWatchExecutor) sendLiveQueriesToChannel(req *backend.QueryDataRequest, responseChannel chan plugins.DataResponse) { |
|
|
|
|
func (e *cloudWatchExecutor) sendLiveQueriesToChannel(req *backend.QueryDataRequest, responseChannel chan *backend.QueryDataResponse) { |
|
|
|
|
defer close(responseChannel) |
|
|
|
|
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) |
|
|
|
@ -213,7 +212,7 @@ func (e *cloudWatchExecutor) fetchConcurrentQueriesQuota(region string, pluginCt |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//nolint: staticcheck // plugins.DataResponse deprecated
|
|
|
|
|
func (e *cloudWatchExecutor) startLiveQuery(ctx context.Context, responseChannel chan plugins.DataResponse, query backend.DataQuery, timeRange backend.TimeRange, pluginCtx backend.PluginContext) error { |
|
|
|
|
func (e *cloudWatchExecutor) startLiveQuery(ctx context.Context, responseChannel chan *backend.QueryDataResponse, query backend.DataQuery, timeRange backend.TimeRange, pluginCtx backend.PluginContext) error { |
|
|
|
|
model, err := simplejson.NewJson(query.JSON) |
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
@ -295,11 +294,10 @@ func (e *cloudWatchExecutor) startLiveQuery(ctx context.Context, responseChannel |
|
|
|
|
dataFrames = data.Frames{dataFrame} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
responseChannel <- plugins.DataResponse{ |
|
|
|
|
Results: map[string]plugins.DataQueryResult{ |
|
|
|
|
responseChannel <- &backend.QueryDataResponse{ |
|
|
|
|
Responses: backend.Responses{ |
|
|
|
|
query.RefID: { |
|
|
|
|
RefID: query.RefID, |
|
|
|
|
Dataframes: plugins.NewDecodedDataFrames(dataFrames), |
|
|
|
|
Frames: dataFrames, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|