Commit 7569a860 by kay delaney Committed by GitHub

Explore/Loki: Fix handling of legacy log row context request (#21767)

Closes #21695
parent 00fa30f2
......@@ -491,6 +491,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
switchMap((res: { data: LokiStreamResponse; status: number }) =>
iif(
() => res.status === 404,
defer(() =>
this._request(LEGACY_QUERY_ENDPOINT, target).pipe(
catchError((err: any) => {
const error: DataQueryError = {
......@@ -503,13 +504,16 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
map((res: { data: LokiLegacyStreamResponse }) => ({
data: res.data ? res.data.streams.map(stream => legacyLogStreamToDataFrame(stream, reverse)) : [],
}))
)
),
defer(() =>
of({
data: res.data ? res.data.data.result.map(stream => lokiStreamResultToDataFrame(stream, reverse)) : [],
})
)
)
)
)
.toPromise();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment