Commit 303bbb99 by Marcus Efraimsson Committed by GitHub

CloudWatch: Fix ordering of map to resolve flaky test (#21572)

parent e18d35ad
...@@ -2,6 +2,7 @@ package cloudwatch ...@@ -2,6 +2,7 @@ package cloudwatch
import ( import (
"fmt" "fmt"
"sort"
"strconv" "strconv"
"strings" "strings"
"time" "time"
...@@ -80,7 +81,14 @@ func parseGetMetricDataTimeSeries(metricDataResults map[string]*cloudwatch.Metri ...@@ -80,7 +81,14 @@ func parseGetMetricDataTimeSeries(metricDataResults map[string]*cloudwatch.Metri
Points: make([]tsdb.TimePoint, 0), Points: make([]tsdb.TimePoint, 0),
} }
for key, values := range query.Dimensions { keys := make([]string, 0)
for k := range query.Dimensions {
keys = append(keys, k)
}
sort.Strings(keys)
for _, key := range keys {
values := query.Dimensions[key]
if len(values) == 1 && values[0] != "*" { if len(values) == 1 && values[0] != "*" {
series.Tags[key] = values[0] series.Tags[key] = values[0]
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment