Elasticsearch and Cloudwatch: Replace deprecated experimental/errorsource (#97363)

* Update elasticsearch

* Update azure monitor

* Update test

* Revert "Update azure monitor"

This reverts commit 21b53845b8.

* Update cloudwatch
This commit is contained in:
Ivana Huckova
2024-12-12 10:12:03 +01:00
committed by GitHub
parent ded90fa28d
commit 7de65b39b5
12 changed files with 47 additions and 49 deletions
+2 -3
View File
@@ -11,7 +11,6 @@ import (
"github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/kinds/dataquery"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/utils"
@@ -56,9 +55,9 @@ var executeSyncLogQuery = func(ctx context.Context, e *cloudWatchExecutor, req *
}
getQueryResultsOutput, err := e.syncQuery(ctx, logsClient, q, logsQuery, instance.Settings.LogsTimeout.Duration)
var sourceError errorsource.Error
var sourceError backend.ErrorWithSource
if errors.As(err, &sourceError) {
errorsource.AddErrorToResponse(refId, resp, sourceError)
resp.Responses[refId] = backend.ErrorResponseWithErrorSource(sourceError)
continue
}
if err != nil {