mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: miscllaneous UI fixes & improvements (#33734)
This commit is contained in:
@@ -11,6 +11,14 @@ export enum PromAlertingRuleState {
|
||||
Pending = 'pending',
|
||||
}
|
||||
|
||||
export enum GrafanaAlertState {
|
||||
Normal = 'Normal',
|
||||
Alerting = 'Alerting',
|
||||
Pending = 'Pending',
|
||||
NoData = 'NoData',
|
||||
Error = 'Error',
|
||||
}
|
||||
|
||||
export enum PromRuleType {
|
||||
Alerting = 'alerting',
|
||||
Recording = 'recording',
|
||||
@@ -29,7 +37,7 @@ export interface PromAlertingRuleDTO extends PromRuleDTOBase {
|
||||
alerts: Array<{
|
||||
labels: Labels;
|
||||
annotations: Annotations;
|
||||
state: Exclude<PromAlertingRuleState, PromAlertingRuleState.Inactive>;
|
||||
state: Exclude<PromAlertingRuleState | GrafanaAlertState, PromAlertingRuleState.Inactive>;
|
||||
activeAt: string;
|
||||
value: string;
|
||||
}>;
|
||||
@@ -86,7 +94,7 @@ export interface RulerAlertingRuleDTO extends RulerRuleBaseDTO {
|
||||
annotations?: Annotations;
|
||||
}
|
||||
|
||||
export enum GrafanaAlertState {
|
||||
export enum GrafanaAlertStateDecision {
|
||||
Alerting = 'Alerting',
|
||||
NoData = 'NoData',
|
||||
KeepLastState = 'KeepLastState',
|
||||
@@ -104,8 +112,8 @@ export interface PostableGrafanaRuleDefinition {
|
||||
uid?: string;
|
||||
title: string;
|
||||
condition: string;
|
||||
no_data_state: GrafanaAlertState;
|
||||
exec_err_state: GrafanaAlertState;
|
||||
no_data_state: GrafanaAlertStateDecision;
|
||||
exec_err_state: GrafanaAlertStateDecision;
|
||||
data: GrafanaQuery[];
|
||||
}
|
||||
export interface GrafanaRuleDefinition extends PostableGrafanaRuleDefinition {
|
||||
|
||||
@@ -8,13 +8,14 @@ import {
|
||||
Labels,
|
||||
Annotations,
|
||||
RulerRuleGroupDTO,
|
||||
GrafanaAlertState,
|
||||
} from './unified-alerting-dto';
|
||||
|
||||
export type Alert = {
|
||||
activeAt: string;
|
||||
annotations: { [key: string]: string };
|
||||
labels: { [key: string]: string };
|
||||
state: PromAlertingRuleState;
|
||||
state: PromAlertingRuleState | GrafanaAlertState;
|
||||
value: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user