Loki: Improve live tailing errors and fix Explore's logs container type errors (#30517)

* If error - catch and show, if no logs - return null

* Refactor LogsContainer to use ConnectedProps

* Fix typescript error

* Remove no logs check

* Include review feedback

* Add SplitOpen type to createSpanLink and TraceView
This commit is contained in:
Ivana Huckova
2021-01-25 17:05:27 +01:00
committed by GitHub
parent 80294b2dbf
commit 347343f583
8 changed files with 40 additions and 63 deletions

View File

@@ -1,6 +1,6 @@
// Libraries
import { cloneDeep, isEmpty, map as lodashMap } from 'lodash';
import { merge, Observable, of } from 'rxjs';
import { merge, Observable, of, throwError } from 'rxjs';
import { catchError, map, switchMap } from 'rxjs/operators';
import Prism from 'prismjs';
@@ -263,7 +263,10 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
data: data || [],
key: `loki-${liveTarget.refId}`,
state: LoadingState.Streaming,
}))
})),
catchError((err: any) => {
return throwError(`Live tailing was stopped due to following error: ${err.reason}`);
})
);
};

View File

@@ -60,7 +60,7 @@ export class LiveStreams {
// Retry every 5s
return timer(retryInterval);
}
return throwError(`error: ${error.reason}`);
return throwError(error);
})
)
),