Alerting: show state history (#42362)

This commit is contained in:
Gilles De Mey
2021-12-14 16:36:54 +01:00
committed by GitHub
parent dc57bcd458
commit 02039d7532
12 changed files with 278 additions and 6 deletions

View File

@@ -124,6 +124,7 @@ export interface PostableGrafanaRuleDefinition {
data: AlertQuery[];
}
export interface GrafanaRuleDefinition extends PostableGrafanaRuleDefinition {
id?: string;
uid: string;
namespace_uid: string;
namespace_id: number;

View File

@@ -1,6 +1,6 @@
/* Prometheus internal models */
import { DataSourceInstanceSettings } from '@grafana/data';
import { AlertState, DataSourceInstanceSettings } from '@grafana/data';
import {
PromAlertingRuleState,
PromRuleType,
@@ -140,3 +140,35 @@ export interface SilenceFilterState {
queryString?: string;
silenceState?: string;
}
interface EvalMatch {
metric: string;
tags?: any;
value: number;
}
export interface StateHistoryItemData {
noData: boolean;
evalMatches?: EvalMatch[];
}
export interface StateHistoryItem {
id: number;
alertId: number;
alertName: string;
dashboardId: number;
panelId: number;
userId: number;
newState: AlertState;
prevState: AlertState;
created: number;
updated: number;
time: number;
timeEnd: number;
text: string;
tags: any[];
login: string;
email: string;
avatarUrl: string;
data: StateHistoryItemData;
}