mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Influx/flux: include interpolated query with error (#25665)
with execution errors, return a Frame that has Meta.ExecutedQueryString.
This commit is contained in:
parent
e2ba0731e2
commit
36fd746c5d
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user