mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
add case for empty influxdb 1 versions, so the health check doesn't fail (#56426)
This commit is contained in:
@@ -100,6 +100,11 @@ func CheckInfluxQLHealth(ctx context.Context, dsInfo *models.DatasourceInfo, s *
|
||||
if res.Error != nil {
|
||||
return getHealthCheckMessage(s, "error reading influxDB", res.Error)
|
||||
}
|
||||
|
||||
if len(res.Frames) == 0 {
|
||||
return getHealthCheckMessage(s, "0 measurements found", nil)
|
||||
}
|
||||
|
||||
if len(res.Frames) > 0 && len(res.Frames[0].Fields) > 0 {
|
||||
return getHealthCheckMessage(s, fmt.Sprintf("%d measurements found", res.Frames[0].Fields[0].Len()), nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user