|
|
|
@ -1362,13 +1362,14 @@ describe('LokiDatasource', () => { |
|
|
|
|
expect(ds.getSupplementaryRequest(SupplementaryQueryType.LogsVolume, options)).toBeDefined(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('does not create provider if there is only an instant logs query', () => { |
|
|
|
|
it('does create provider if there is only an instant logs query', () => { |
|
|
|
|
// we changed logic to automatically run logs queries as range queries, thus there's a provider now
|
|
|
|
|
const options: DataQueryRequest<LokiQuery> = { |
|
|
|
|
...baseRequestOptions, |
|
|
|
|
targets: [{ expr: '{label="value"', refId: 'A', queryType: LokiQueryType.Instant }], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
expect(ds.getSupplementaryRequest(SupplementaryQueryType.LogsVolume, options)).not.toBeDefined(); |
|
|
|
|
expect(ds.getSupplementaryRequest(SupplementaryQueryType.LogsVolume, options)).toBeDefined(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -1454,7 +1455,8 @@ describe('LokiDatasource', () => { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('does not return logs volume query for instant log query', () => { |
|
|
|
|
it('does return logs volume query for instant log query', () => { |
|
|
|
|
// we changed logic to automatically run logs queries as range queries, thus there's a volume query now
|
|
|
|
|
expect( |
|
|
|
|
ds.getSupplementaryQuery( |
|
|
|
|
{ type: SupplementaryQueryType.LogsVolume }, |
|
|
|
@ -1464,7 +1466,13 @@ describe('LokiDatasource', () => { |
|
|
|
|
refId: 'A', |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
).toEqual(undefined); |
|
|
|
|
).toEqual({ |
|
|
|
|
expr: 'sum by (level) (count_over_time({label="value"} | drop __error__[$__auto]))', |
|
|
|
|
legendFormat: '{{ level }}', |
|
|
|
|
queryType: 'range', |
|
|
|
|
refId: 'log-volume-A', |
|
|
|
|
supportingQueryType: 'logsVolume', |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('does not return logs volume query for metric query', () => { |
|
|
|
|