mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
loki: backend-mode: allow for dashboards too (#47578)
This commit is contained in:
parent
a5530d36a7
commit
8db35b9b0b
@ -8,7 +8,6 @@ import Prism from 'prismjs';
|
|||||||
import {
|
import {
|
||||||
AnnotationEvent,
|
AnnotationEvent,
|
||||||
AnnotationQueryRequest,
|
AnnotationQueryRequest,
|
||||||
CoreApp,
|
|
||||||
DataFrame,
|
DataFrame,
|
||||||
DataFrameView,
|
DataFrameView,
|
||||||
DataQueryError,
|
DataQueryError,
|
||||||
@ -153,9 +152,7 @@ export class LokiDatasource
|
|||||||
...this.getRangeScopedVars(request.range),
|
...this.getRangeScopedVars(request.range),
|
||||||
};
|
};
|
||||||
|
|
||||||
const shouldRunBackendQuery = config.featureToggles.lokiBackendMode && request.app === CoreApp.Explore;
|
if (config.featureToggles.lokiBackendMode) {
|
||||||
|
|
||||||
if (shouldRunBackendQuery) {
|
|
||||||
// we "fix" the loki queries to have `.queryType` and not have `.instant` and `.range`
|
// we "fix" the loki queries to have `.queryType` and not have `.instant` and `.range`
|
||||||
const fixedRequest = {
|
const fixedRequest = {
|
||||||
...request,
|
...request,
|
||||||
@ -789,7 +786,7 @@ export class LokiDatasource
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used when running queries through backend
|
// Used when running queries through backend
|
||||||
applyTemplateVariables(target: LokiQuery, scopedVars: ScopedVars): Record<string, any> {
|
applyTemplateVariables(target: LokiQuery, scopedVars: ScopedVars): LokiQuery {
|
||||||
// We want to interpolate these variables on backend
|
// We want to interpolate these variables on backend
|
||||||
const { __interval, __interval_ms, ...rest } = scopedVars;
|
const { __interval, __interval_ms, ...rest } = scopedVars;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user