mirror of https://github.com/grafana/grafana.git
Loki: Add `supportingQueryType` to datasample queries (#77482)
add `supportingQueryType` to datasamples
This commit is contained in:
parent
2d5e602b2d
commit
57835c71b1
|
@ -1254,6 +1254,15 @@ describe('LokiDatasource', () => {
|
|||
})
|
||||
);
|
||||
});
|
||||
it('sets the supporting query type in the request', () => {
|
||||
const spy = jest.spyOn(ds, 'query').mockImplementation(() => of({} as DataQueryResponse));
|
||||
ds.getDataSamples({ expr: '{job="bar"}', refId: 'A' });
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
targets: [expect.objectContaining({ supportingQueryType: SupportingQueryType.DataSample })],
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Query splitting', () => {
|
||||
|
|
|
@ -763,6 +763,7 @@ export class LokiDatasource
|
|||
refId: REF_ID_DATA_SAMPLES,
|
||||
// For samples we limit the request to 10 lines, so queries are small and fast
|
||||
maxLines: 10,
|
||||
supportingQueryType: SupportingQueryType.DataSample,
|
||||
};
|
||||
|
||||
const timeRange = this.getTimeRange();
|
||||
|
|
Loading…
Reference in New Issue