mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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}`);
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export class LiveStreams {
|
||||
// Retry every 5s
|
||||
return timer(retryInterval);
|
||||
}
|
||||
return throwError(`error: ${error.reason}`);
|
||||
return throwError(error);
|
||||
})
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user