Alerting: moving data source uid to query instead of model (#33416)

* initial commit.

* Some more improvements to the expression data source support.

* added tests to verify that time range picker and data source picker only is visible when callbacks is passed to row.

* fixing issue with filter in alerting list.

* minor refactoring.

* removed guarding code, should be fixed in  backend.

* cleaning the data query if we change to a different data source.
This commit is contained in:
Marcus Andersson
2021-04-29 15:10:14 +02:00
committed by GitHub
parent 28ec96788c
commit 9de2f1bb8f
21 changed files with 424 additions and 224 deletions

View File

@@ -92,16 +92,12 @@ export enum GrafanaAlertState {
KeepLastState = 'KeepLastState',
OK = 'OK',
}
export interface GrafanaQueryModel extends DataQuery {
datasource: string;
datasourceUid: string;
}
export interface GrafanaQuery {
refId: string;
queryType: string;
relativeTimeRange: RelativeTimeRange;
model: GrafanaQueryModel;
datasourceUid: string;
model: DataQuery;
}
export interface PostableGrafanaRuleDefinition {

View File

@@ -8,7 +8,6 @@ import {
Labels,
Annotations,
RulerRuleGroupDTO,
GrafanaQueryModel,
} from './unified-alerting-dto';
export type Alert = {
@@ -82,7 +81,6 @@ export interface CombinedRule {
rulerRule?: RulerRuleDTO;
group: CombinedRuleGroup;
namespace: CombinedRuleNamespace;
queries?: GrafanaQueryModel[];
}
export interface CombinedRuleGroup {