mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 17:32:14 +08:00
Fix InfluxDB unhealthy alerts and false "no data"s (#43441)
* check for TimeSeriesTypeNot to fix InfluxDB alerts * log a warning when a data frame is ignored
This commit is contained in:
@ -254,8 +254,16 @@ func (dn *DSNode) Execute(ctx context.Context, vars mathexp.Vars, s *Service) (m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dataSource := dn.datasource.Type
|
||||||
for _, frame := range qr.Frames {
|
for _, frame := range qr.Frames {
|
||||||
logger.Debug("expression datasource query (seriesSet)", "query", refID)
|
logger.Debug("expression datasource query (seriesSet)", "query", refID)
|
||||||
|
// Check for TimeSeriesTypeNot in InfluxDB queries. A data frame of this type will cause
|
||||||
|
// the WideToMany() function to error out, which results in unhealthy alerts.
|
||||||
|
// This check should be removed once inconsistencies in data source responses are solved.
|
||||||
|
if frame.TimeSeriesSchema().Type == data.TimeSeriesTypeNot && dataSource == models.DS_INFLUXDB {
|
||||||
|
logger.Warn("ignoring InfluxDB data frame due to missing numeric fields", "frame", frame)
|
||||||
|
continue
|
||||||
|
}
|
||||||
series, err := WideToMany(frame)
|
series, err := WideToMany(frame)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return mathexp.Results{}, err
|
return mathexp.Results{}, err
|
||||||
|
Reference in New Issue
Block a user