Cloudwatch: Revert aws sdk go v2 (#103644)

* Revert "CloudWatch: Import new grafana-aws-sdk with PDC fix (#103249)"

This reverts commit f2b5b4e0c0.

* Revert "CloudWatch: Migrate to aws-sdk-go-v2 (#103106)"

This reverts commit a65cc0df93.

* make update-workspace
This commit is contained in:
Isabella Siu
2025-04-08 15:40:15 -04:00
committed by GitHub
parent 27e9422f24
commit 13534a7d98
60 changed files with 1599 additions and 1483 deletions
+11 -5
View File
@@ -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 {