]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/prometheus-alerts.ts
import ceph 15.2.13
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / models / prometheus-alerts.ts
1 export class PrometheusAlertLabels {
2 alertname: string;
3 instance: string;
4 job: string;
5 severity: string;
6 }
7
8 class Annotations {
9 description: string;
10 }
11
12 class CommonAlertmanagerAlert {
13 labels: PrometheusAlertLabels;
14 annotations: Annotations;
15 startsAt: string; // Date string
16 endsAt: string; // Date string
17 generatorURL: string;
18 }
19
20 class PrometheusAlert {
21 labels: PrometheusAlertLabels;
22 annotations: Annotations;
23 state: 'pending' | 'firing';
24 activeAt: string; // Date string
25 value: number;
26 }
27
28 export interface PrometheusRuleGroup {
29 name: string;
30 file: string;
31 rules: PrometheusRule[];
32 }
33
34 export class PrometheusRule {
35 name: string; // => PrometheusAlertLabels.alertname
36 query: string;
37 duration: 10;
38 labels: {
39 severity: string; // => PrometheusAlertLabels.severity
40 };
41 annotations: Annotations;
42 alerts: PrometheusAlert[]; // Shows only active alerts
43 health: string;
44 type: string;
45 group?: string; // Added field for flattened list
46 }
47
48 export class AlertmanagerAlert extends CommonAlertmanagerAlert {
49 status: {
50 state: 'unprocessed' | 'active' | 'suppressed';
51 silencedBy: null | string[];
52 inhibitedBy: null | string[];
53 };
54 receivers: string[];
55 fingerprint: string;
56 }
57
58 export class AlertmanagerNotificationAlert extends CommonAlertmanagerAlert {
59 status: 'firing' | 'resolved';
60 }
61
62 export class AlertmanagerNotification {
63 status: 'firing' | 'resolved';
64 groupLabels: object;
65 commonAnnotations: object;
66 groupKey: string;
67 notified: string;
68 id: string;
69 alerts: AlertmanagerNotificationAlert[];
70 version: string;
71 receiver: string;
72 externalURL: string;
73 commonLabels: {
74 severity: string;
75 };
76 }
77
78 export class PrometheusCustomAlert {
79 status: 'resolved' | 'unprocessed' | 'active' | 'suppressed';
80 name: string;
81 url: string;
82 description: string;
83 fingerprint?: string | boolean;
84 }