mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
CloudWatch: Use generated type from schema in backend (#66420)
* CloudWatch: Use generated type from schema in backend * address comments * don't explicity set default metric query type
This commit is contained in:
@@ -10,6 +10,7 @@ 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/pkg/tsdb/cloudwatch/kinds/dataquery"
|
||||
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
|
||||
)
|
||||
|
||||
@@ -29,7 +30,9 @@ var executeSyncLogQuery = func(ctx context.Context, e *cloudWatchExecutor, req *
|
||||
}
|
||||
|
||||
logsQuery.Subtype = "StartQuery"
|
||||
logsQuery.QueryString = logsQuery.Expression
|
||||
if logsQuery.Expression != nil {
|
||||
logsQuery.QueryString = *logsQuery.Expression
|
||||
}
|
||||
|
||||
region := logsQuery.Region
|
||||
if logsQuery.Region == "" || region == defaultRegion {
|
||||
@@ -86,7 +89,9 @@ func (e *cloudWatchExecutor) syncQuery(ctx context.Context, logsClient cloudwatc
|
||||
}
|
||||
|
||||
requestParams := models.LogsQuery{
|
||||
Region: logsQuery.Region,
|
||||
CloudWatchLogsQuery: dataquery.CloudWatchLogsQuery{
|
||||
Region: logsQuery.Region,
|
||||
},
|
||||
QueryId: *startQueryOutput.QueryId,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user