[v9.4.x] CloudMonitoring: Fix crash when inspecting data for MQL queries (#63756)
CloudMonitoring: Fix crash when inspecting data for MQL queries (#63747)
CloudMonitoring: Fix missing Field name
This happened for MQL queries that used an [aggregate function][1], e.g.
`sum`.
[1]: https://cloud.google.com/monitoring/mql/reference#aggr-function-group
(cherry picked from commit 3672e44c1c)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This commit is contained in:
co-authored by
Adam Simpson
parent
f8120e9152
commit
b5747d397d
@@ -480,7 +480,11 @@ func calculateAlignmentPeriod(alignmentPeriod string, intervalMs int64, duration
|
||||
func formatLegendKeys(metricType string, defaultMetricName string, labels map[string]string,
|
||||
additionalLabels map[string]string, query cloudMonitoringQueryExecutor) string {
|
||||
if query.getAliasBy() == "" {
|
||||
return defaultMetricName
|
||||
if defaultMetricName != "" {
|
||||
return defaultMetricName
|
||||
}
|
||||
|
||||
return metricType
|
||||
}
|
||||
|
||||
result := legendKeyFormat.ReplaceAllFunc([]byte(query.getAliasBy()), func(in []byte) []byte {
|
||||
|
||||
Reference in New Issue
Block a user