Cloudwatch: Revert aws sdk go v2 (#103644)
* Revert "CloudWatch: Import new grafana-aws-sdk with PDC fix (#103249)" This reverts commitf2b5b4e0c0. * Revert "CloudWatch: Migrate to aws-sdk-go-v2 (#103106)" This reverts commita65cc0df93. * make update-workspace
This commit is contained in:
@@ -8,8 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
|
||||
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/features"
|
||||
@@ -89,7 +88,7 @@ func aggregateResponse(getMetricDataOutputs []*cloudwatch.GetMetricDataOutput) m
|
||||
}
|
||||
}
|
||||
|
||||
response.AddMetricDataResult(&r)
|
||||
response.AddMetricDataResult(r)
|
||||
responseByID[id] = response
|
||||
}
|
||||
}
|
||||
@@ -229,9 +228,16 @@ func buildDataFrames(ctx context.Context, aggregatedResponse models.QueryRowResp
|
||||
} else {
|
||||
labels = getLabels(label, query, false)
|
||||
}
|
||||
timestamps := []*time.Time{}
|
||||
points := []*float64{}
|
||||
for j, t := range metric.Timestamps {
|
||||
val := metric.Values[j]
|
||||
timestamps = append(timestamps, t)
|
||||
points = append(points, val)
|
||||
}
|
||||
|
||||
timeField := data.NewField(data.TimeSeriesTimeFieldName, nil, metric.Timestamps)
|
||||
valueField := data.NewField(data.TimeSeriesValueFieldName, labels, metric.Values)
|
||||
timeField := data.NewField(data.TimeSeriesTimeFieldName, nil, timestamps)
|
||||
valueField := data.NewField(data.TimeSeriesValueFieldName, labels, points)
|
||||
|
||||
// CloudWatch appends the dimensions to the returned label if the query label is not dynamic, so static labels need to be set
|
||||
if hasStaticLabel {
|
||||
|
||||
Reference in New Issue
Block a user