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