Loki: Add logsample supporting query type (#92082)

* Loki: Add `logsample` supporting query type

* use `SupportingQueryType`

* add missing test
This commit is contained in:
Sven Grossmann 2024-08-22 09:12:50 +02:00 committed by GitHub
parent db711d6a21
commit 40cdfeb00b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -1529,6 +1529,7 @@ describe('LokiDatasource', () => {
queryType: 'range',
refId: 'log-sample-A',
maxLines: 20,
supportingQueryType: SupportingQueryType.LogsSample,
});
});
@ -1547,6 +1548,7 @@ describe('LokiDatasource', () => {
queryType: LokiQueryType.Range,
refId: 'log-sample-A',
maxLines: 20,
supportingQueryType: SupportingQueryType.LogsSample,
});
});
@ -1564,6 +1566,7 @@ describe('LokiDatasource', () => {
expr: '{label="value"}',
queryType: LokiQueryType.Range,
refId: 'log-sample-A',
supportingQueryType: SupportingQueryType.LogsSample,
maxLines: 5,
});
});

View File

@ -242,6 +242,7 @@ export class LokiDatasource
refId: `${REF_ID_STARTER_LOG_SAMPLE}${normalizedQuery.refId}`,
expr: getLogQueryFromMetricsQuery(expr),
maxLines: Number.isNaN(Number(options.limit)) ? this.maxLines : Number(options.limit),
supportingQueryType: SupportingQueryType.LogsSample,
};
default: