diff --git a/public/app/plugins/datasource/loki/datasource.test.ts b/public/app/plugins/datasource/loki/datasource.test.ts index 2f789da2dd0..ff23e68c88c 100644 --- a/public/app/plugins/datasource/loki/datasource.test.ts +++ b/public/app/plugins/datasource/loki/datasource.test.ts @@ -932,8 +932,7 @@ describe('LokiDatasource', () => { ) ).toEqual({ expr: 'sum by (level) (count_over_time({label=value}[$__interval]))', - instant: false, - queryType: 'range', + queryType: LokiQueryType.Range, refId: 'log-volume-A', supportingQueryType: SupportingQueryType.LogsVolume, }); @@ -997,7 +996,7 @@ describe('LokiDatasource', () => { ) ).toEqual({ expr: '{label=value}', - queryType: 'instant', + queryType: LokiQueryType.Range, refId: 'log-sample-A', maxLines: 20, }); @@ -1015,7 +1014,7 @@ describe('LokiDatasource', () => { ) ).toEqual({ expr: '{label=value}', - queryType: 'instant', + queryType: LokiQueryType.Range, refId: 'log-sample-A', maxLines: 5, }); diff --git a/public/app/plugins/datasource/loki/datasource.ts b/public/app/plugins/datasource/loki/datasource.ts index 674c382489e..e63e7ed127f 100644 --- a/public/app/plugins/datasource/loki/datasource.ts +++ b/public/app/plugins/datasource/loki/datasource.ts @@ -193,7 +193,7 @@ export class LokiDatasource return { ...normalizedQuery, refId: `${REF_ID_STARTER_LOG_VOLUME}${normalizedQuery.refId}`, - instant: false, + queryType: LokiQueryType.Range, supportingQueryType: SupportingQueryType.LogsVolume, expr: `sum by (level) (count_over_time(${expr}[$__interval]))`, }; @@ -206,6 +206,7 @@ export class LokiDatasource } return { ...normalizedQuery, + queryType: LokiQueryType.Range, refId: `${REF_ID_STARTER_LOG_SAMPLE}${normalizedQuery.refId}`, expr: getLogQueryFromMetricsQuery(expr), maxLines: Number.isNaN(Number(options.limit)) ? this.maxLines : Number(options.limit),