From 1bed84ea56aab7938bc5ab3b9bde253ef19373ab Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 27 Jan 2022 10:53:27 -0300 Subject: [PATCH] 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 --- pkg/expr/nodes.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/expr/nodes.go b/pkg/expr/nodes.go index 444a09be3a1..7a1f90c2bbe 100644 --- a/pkg/expr/nodes.go +++ b/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