[v9.2.x] Google Cloud Monitoring: Set frame interval to draw null values (#57914)
This commit is contained in:
@@ -663,7 +663,7 @@ func unmarshalResponse(res *http.Response) (cloudMonitoringResponse, error) {
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func addConfigData(frames data.Frames, dl string, unit string) data.Frames {
|
||||
func addConfigData(frames data.Frames, dl string, unit string, period string) data.Frames {
|
||||
for i := range frames {
|
||||
if frames[i].Fields[1].Config == nil {
|
||||
frames[i].Fields[1].Config = &data.FieldConfig{}
|
||||
@@ -681,6 +681,15 @@ func addConfigData(frames data.Frames, dl string, unit string) data.Frames {
|
||||
frames[i].Fields[1].Config.Unit = val
|
||||
}
|
||||
}
|
||||
if frames[i].Fields[0].Config == nil {
|
||||
frames[i].Fields[0].Config = &data.FieldConfig{}
|
||||
}
|
||||
if period != "" {
|
||||
err := addInterval(period, frames[i].Fields[0])
|
||||
if err != nil {
|
||||
slog.Error("Failed to add interval", "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return frames
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user