mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Add logsample
supporting query type (#92082)
* Loki: Add `logsample` supporting query type * use `SupportingQueryType` * add missing test
This commit is contained in:
parent
db711d6a21
commit
40cdfeb00b
@ -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,
|
||||
});
|
||||
});
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user