Loki: Add logsample supporting query type (#92082)
* Loki: Add `logsample` supporting query type * use `SupportingQueryType` * add missing test
This commit is contained in:
@@ -1529,6 +1529,7 @@ describe('LokiDatasource', () => {
|
|||||||
queryType: 'range',
|
queryType: 'range',
|
||||||
refId: 'log-sample-A',
|
refId: 'log-sample-A',
|
||||||
maxLines: 20,
|
maxLines: 20,
|
||||||
|
supportingQueryType: SupportingQueryType.LogsSample,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1547,6 +1548,7 @@ describe('LokiDatasource', () => {
|
|||||||
queryType: LokiQueryType.Range,
|
queryType: LokiQueryType.Range,
|
||||||
refId: 'log-sample-A',
|
refId: 'log-sample-A',
|
||||||
maxLines: 20,
|
maxLines: 20,
|
||||||
|
supportingQueryType: SupportingQueryType.LogsSample,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1564,6 +1566,7 @@ describe('LokiDatasource', () => {
|
|||||||
expr: '{label="value"}',
|
expr: '{label="value"}',
|
||||||
queryType: LokiQueryType.Range,
|
queryType: LokiQueryType.Range,
|
||||||
refId: 'log-sample-A',
|
refId: 'log-sample-A',
|
||||||
|
supportingQueryType: SupportingQueryType.LogsSample,
|
||||||
maxLines: 5,
|
maxLines: 5,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ export class LokiDatasource
|
|||||||
refId: `${REF_ID_STARTER_LOG_SAMPLE}${normalizedQuery.refId}`,
|
refId: `${REF_ID_STARTER_LOG_SAMPLE}${normalizedQuery.refId}`,
|
||||||
expr: getLogQueryFromMetricsQuery(expr),
|
expr: getLogQueryFromMetricsQuery(expr),
|
||||||
maxLines: Number.isNaN(Number(options.limit)) ? this.maxLines : Number(options.limit),
|
maxLines: Number.isNaN(Number(options.limit)) ? this.maxLines : Number(options.limit),
|
||||||
|
supportingQueryType: SupportingQueryType.LogsSample,
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user