Explore: elastic small fixes (#18879)

- Fix cancellation error showing in UI
- Fix display of object values in log rows
pull/18881/head
Andrej Ocenas 6 years ago committed by GitHub
parent e0e3a4db54
commit aab224ef29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/grafana-ui/src/types/datasource.ts
  2. 4
      public/app/core/logs_model.ts
  3. 2
      public/app/features/explore/Table.tsx
  4. 4
      public/app/features/explore/state/reducers.ts

@ -425,6 +425,7 @@ export interface DataQueryError {
status?: string;
statusText?: string;
refId?: string;
cancelled?: boolean;
}
export interface ScopedVar {

@ -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) {

@ -46,7 +46,7 @@ export default class Table extends PureComponent<TableProps> {
show: text !== 'Time',
Cell: (row: any) => (
<span className={filterable ? 'link' : ''} title={text + ': ' + row.value}>
{row.value}
{typeof row.value === 'string' ? row.value : JSON.stringify(row.value)}
</span>
),
}));

@ -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);

Loading…
Cancel
Save