Commit 36fd746c by Kyle Brandt Committed by GitHub

Influx/flux: include interpolated query with error (#25665)

with execution errors, return a Frame that has Meta.ExecutedQueryString.
parent e2ba0731
......@@ -25,6 +25,11 @@ func ExecuteQuery(ctx context.Context, query QueryModel, runner queryRunner, max
tables, err := runner.runQuery(ctx, flux)
if err != nil {
dr.Error = err
metaFrame := data.NewFrame("meta for error")
metaFrame.Meta = &data.FrameMeta{
ExecutedQueryString: flux,
}
dr.Frames = append(dr.Frames, metaFrame)
return
}
......
......@@ -90,10 +90,7 @@ func RunnerFromDataSource(dsInfo *models.DataSource) (*Runner, error) {
func backendDataResponseToTSDBResponse(dr *backend.DataResponse, refID string) *tsdb.QueryResult {
qr := &tsdb.QueryResult{RefId: refID}
if dr.Error != nil {
qr.Error = dr.Error
return qr
}
qr.Error = dr.Error
if dr.Frames != nil {
qr.Dataframes = tsdb.NewDecodedDataFrames(dr.Frames)
......
......@@ -66,7 +66,7 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
}
}
// Proces flux queries (data frame request)
// Process flux queries (data frame request)
if (hasFlux) {
if (!this.enableFlux) {
throw 'Flux not enabled for this datasource';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment