mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
loki: backend-mode: fix experimental stream-mode (#48936)
This commit is contained in:
parent
c1b56e79ef
commit
8b9419222a
@ -175,6 +175,17 @@ export class LokiDatasource
|
||||
targets: request.targets.map(getNormalizedLokiQuery),
|
||||
};
|
||||
|
||||
const streamQueries = fixedRequest.targets.filter((q) => q.queryType === LokiQueryType.Stream);
|
||||
if (config.featureToggles.lokiLive && streamQueries.length > 0 && fixedRequest.rangeRaw?.to === 'now') {
|
||||
// this is still an in-development feature,
|
||||
// we do not support mixing stream-queries with normal-queries for now.
|
||||
const streamRequest = {
|
||||
...fixedRequest,
|
||||
targets: streamQueries,
|
||||
};
|
||||
return merge(...streamQueries.map((q) => doLokiChannelStream(q, this, streamRequest)));
|
||||
}
|
||||
|
||||
if (fixedRequest.liveStreaming) {
|
||||
return this.runLiveQueryThroughBackend(fixedRequest);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user