mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
loki: backend-mode: apply default max-lines if not set in the UI (#48859)
This commit is contained in:
parent
7f29c2696d
commit
93e299305c
@ -173,10 +173,13 @@ export class LokiDatasource
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (this.useBackendMode) {
|
if (this.useBackendMode) {
|
||||||
// we "fix" the loki queries to have `.queryType` and not have `.instant` and `.range`
|
const queries = request.targets
|
||||||
|
.map(getNormalizedLokiQuery) // "fix" the `.queryType` prop
|
||||||
|
.map((q) => ({ ...q, maxLines: q.maxLines || this.maxLines })); // set maxLines if not set
|
||||||
|
|
||||||
const fixedRequest = {
|
const fixedRequest = {
|
||||||
...request,
|
...request,
|
||||||
targets: request.targets.map(getNormalizedLokiQuery),
|
targets: queries,
|
||||||
};
|
};
|
||||||
|
|
||||||
const streamQueries = fixedRequest.targets.filter((q) => q.queryType === LokiQueryType.Stream);
|
const streamQueries = fixedRequest.targets.filter((q) => q.queryType === LokiQueryType.Stream);
|
||||||
|
Loading…
Reference in New Issue
Block a user