CloudWatch: Handle log alerts queries where the time field is not the first field (#108277)

CloudWatch: handle log alerts queries where the time field is not the first field
pull/108332/head
Kevin Yu 2 days ago committed by GitHub
parent a49b35a7ec
commit f009c2dcdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      pkg/tsdb/cloudwatch/log_query.go

@ -202,8 +202,12 @@ func groupResults(results *data.Frame, groupingFieldNames []string, fromSyncQuer
groupLabels := generateLabels(groupingFields, i)
// set the group key as the display name for sync queries
for j := 1; j < len(newFrame.Fields); j++ {
for j := 0; j < len(newFrame.Fields); j++ {
valueField := newFrame.Fields[j]
// the time field might not be the first field so we check it here and skip the field if it is
if valueField.Type().Time() {
continue
}
if valueField.Config == nil {
valueField.Config = &data.FieldConfig{}
}

Loading…
Cancel
Save