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
pull/44543/head
Santiago 3 years ago committed by GitHub
parent 41c8db16ee
commit 1bed84ea56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      pkg/expr/nodes.go

@ -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 {
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)
if err != nil {
return mathexp.Results{}, err

Loading…
Cancel
Save