diff --git a/packages/grafana-ui/src/types/datasource.ts b/packages/grafana-ui/src/types/datasource.ts index 61bcd6a5e10..debfa57de2c 100644 --- a/packages/grafana-ui/src/types/datasource.ts +++ b/packages/grafana-ui/src/types/datasource.ts @@ -425,6 +425,7 @@ export interface DataQueryError { status?: string; statusText?: string; refId?: string; + cancelled?: boolean; } export interface ScopedVar { diff --git a/public/app/core/logs_model.ts b/public/app/core/logs_model.ts index 6024987a2fa..763d175548f 100644 --- a/public/app/core/logs_model.ts +++ b/public/app/core/logs_model.ts @@ -260,7 +260,9 @@ export function logSeriesToLogsModel(logSeries: DataFrame[]): LogsModel { const timeLocal = time.format('YYYY-MM-DD HH:mm:ss'); const timeUtc = toUtc(ts).format('YYYY-MM-DD HH:mm:ss'); - const message = stringField.values.get(j); + let message = stringField.values.get(j); + // This should be string but sometimes isn't (eg elastic) because the dataFrame is not strongly typed. + message = typeof message === 'string' ? message : JSON.stringify(message); let logLevel = LogLevel.unknown; if (logLevelField) { diff --git a/public/app/features/explore/Table.tsx b/public/app/features/explore/Table.tsx index 39921c83977..cc93d79bcb1 100644 --- a/public/app/features/explore/Table.tsx +++ b/public/app/features/explore/Table.tsx @@ -46,7 +46,7 @@ export default class Table extends PureComponent { show: text !== 'Time', Cell: (row: any) => ( - {row.value} + {typeof row.value === 'string' ? row.value : JSON.stringify(row.value)} ), })); diff --git a/public/app/features/explore/state/reducers.ts b/public/app/features/explore/state/reducers.ts index eeffbeb6543..f54c0e3dc27 100644 --- a/public/app/features/explore/state/reducers.ts +++ b/public/app/features/explore/state/reducers.ts @@ -589,6 +589,10 @@ export const processQueryResponse = ( const replacePreviousResults = action.type === queryEndedAction.type; if (error) { + if (error.cancelled) { + return state; + } + // For Angular editors state.eventBridge.emit('data-error', error);