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
This commit is contained in:
@@ -481,7 +481,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