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