mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Make Loki & Prometheus instant vector by default (#66797)
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
This commit is contained in:
@@ -1263,6 +1263,33 @@ export class PrometheusDatasource
|
||||
getCacheDurationInMinutes(): number {
|
||||
return getClientCacheDurationInMinutes(this.cacheLevel);
|
||||
}
|
||||
|
||||
getDefaultQuery(app: CoreApp): PromQuery {
|
||||
const defaults = {
|
||||
refId: 'A',
|
||||
expr: '',
|
||||
range: true,
|
||||
instant: false,
|
||||
};
|
||||
|
||||
if (app === CoreApp.UnifiedAlerting) {
|
||||
return {
|
||||
...defaults,
|
||||
instant: true,
|
||||
range: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (app === CoreApp.Explore) {
|
||||
return {
|
||||
...defaults,
|
||||
instant: true,
|
||||
range: true,
|
||||
};
|
||||
}
|
||||
|
||||
return defaults;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user