]>
Commit | Line | Data |
---|---|---|
494da23a TL |
1 | export class PrometheusAlertLabels { |
2 | alertname: string; | |
3 | instance: string; | |
4 | job: string; | |
5 | severity: string; | |
6 | } | |
7 | ||
8 | class Annotations { | |
9 | description: string; | |
1e59de90 | 10 | summary: string; |
494da23a TL |
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 | ||
9f95a23c TL |
29 | export interface PrometheusRuleGroup { |
30 | name: string; | |
31 | file: string; | |
32 | rules: PrometheusRule[]; | |
33 | } | |
34 | ||
494da23a TL |
35 | export 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 | 49 | export 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 | 59 | export class AlertmanagerNotificationAlert extends CommonAlertmanagerAlert { |
11fdf7f2 TL |
60 | status: 'firing' | 'resolved'; |
61 | } | |
62 | ||
494da23a | 63 | export 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 | ||
79 | export 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 | } |