forked from prometheus/alertmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.proto
245 lines (229 loc) · 8.74 KB
/
config.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// Copyright 2013 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package io.prometheus.alertmanager;
// Configuration for notification via PagerDuty.
message PagerDutyConfig {
// PagerDuty service key, see:
// http://developer.pagerduty.com/documentation/integration/events
optional string service_key = 1;
}
// Configuration for notification via mail.
message EmailConfig {
// Email address to notify.
optional string email = 1;
// Notify when resolved.
optional bool send_resolved = 2 [default = false];
}
// Configuration for notification via pushover.net.
message PushoverConfig {
// Pushover token.
optional string token = 1;
// Pushover user_key.
optional string user_key = 2;
// Notify when resolved.
optional bool send_resolved = 3 [default = false];
}
// Configuration for notification via HipChat.
message HipChatConfig {
// https://www.hipchat.com/docs/apiv2/method/send_room_notification
// HipChat auth token, (https://www.hipchat.com/docs/api/auth).
optional string auth_token = 1;
// HipChat room id, (https://www.hipchat.com/rooms/ids).
optional int32 room_id = 2;
// Color of message when triggered.
optional string color = 3 [default = "purple"];
// Color of message when resolved.
optional string color_resolved = 5 [default = "green"];
// Should this message notify or not.
optional bool notify = 4 [default = false];
// Notify when resolved.
optional bool send_resolved = 6 [default = false];
// Prefix to be put in front of the message (useful for @mentions, etc.).
optional string prefix = 7 [default = ""];
// Format the message as "html" or "text".
enum MessageFormat {
HTML = 0;
TEXT = 1;
}
optional MessageFormat message_format = 8 [default = HTML];
}
// Configuration for notification via Slack.
message SlackConfig {
// Slack webhook URL, (https://api.slack.com/incoming-webhooks).
optional string webhook_url = 1;
// Slack channel override, (like #other-channel or @username).
optional string channel = 2;
// Color of message when triggered.
optional string color = 3 [default = "warning"];
// Color of message when resolved.
optional string color_resolved = 4 [default = "good"];
// Notify when resolved.
optional bool send_resolved = 5 [default = false];
}
// Configuration for notification via Flowdock.
message FlowdockConfig {
// Flowdock flow API token.
optional string api_token = 1;
// Flowdock from_address.
optional string from_address = 2;
// Flowdock flow tags.
repeated string tag = 3;
// Notify when resolved.
optional bool send_resolved = 4 [default = false];
}
// Configuration for notification via OpsGenie.
message OpsGenieConfig {
// OpsGenie API token.
optional string api_key = 1;
// List of team names which will be responsible for the alert.
repeated string teams = 2;
// List of labels that have their values converted to tags.
repeated string labels_to_tags = 3;
// Notify when resolved.
optional bool send_resolved = 4 [default = false];
}
// Configuration for notification via generic webhook.
message WebhookConfig {
// URL to send POST request to.
optional string url = 1;
// Notify when resolved.
optional bool send_resolved = 2 [default = false];
}
// Configuration for notification via Amazon SNS.
message AmazonSnsConfig {
// SNS Topic ARN.
optional string topic_arn = 1;
// Notify when resolved.
optional bool send_resolved = 2 [default = false];
}
// Notification configuration definition.
message NotificationConfig {
// Name of this NotificationConfig. Referenced from AggregationRule.
optional string name = 1;
// Zero or more PagerDuty notification configurations.
repeated PagerDutyConfig pagerduty_config = 2;
// Zero or more email notification configurations.
repeated EmailConfig email_config = 3;
// Zero or more pushover notification configurations.
repeated PushoverConfig pushover_config = 4;
// Zero or more hipchat notification configurations.
repeated HipChatConfig hipchat_config = 5;
// Zero or more slack notification configurations.
repeated SlackConfig slack_config = 6;
// Zero or more Flowdock notification configurations.
repeated FlowdockConfig flowdock_config = 7;
// Zero or more generic web hook notification configurations.
repeated WebhookConfig webhook_config = 8;
// Zero or more OpsGenieConfig notification configurations.
repeated OpsGenieConfig opsgenie_config = 9;
// Zero or more Amazon SNS notification configurations.
repeated AmazonSnsConfig amazon_sns_config = 10;
}
// A regex-based label filter used in aggregations.
message Filter {
// The regex matching the label name.
optional string name_re = 1;
// The regex matching the label value.
optional string value_re = 2;
}
// Grouping and notification setting definitions for alerts.
message AggregationRule {
// Filters that define which alerts are matched by this AggregationRule.
repeated Filter filter = 1;
// How many seconds to wait before resending a notification for a specific alert.
optional int32 repeat_rate_seconds = 2 [default = 7200];
// Notification configuration to use for this AggregationRule, referenced by
// their name.
optional string notification_config_name = 3;
}
// An InhibitRule specifies that a class of (source) alerts should inhibit
// notifications for another class of (target) alerts if all specified matching
// labels are equal between the two alerts. This may be used to inhibit alerts
// from sending notifications if their meaning is logically a subset of a
// higher-level alert.
//
// For example, if an entire job is down, there is little sense in sending a
// notification for every single instance of said job being down. This could be
// expressed as the following inhibit rule:
//
// inhibit_rule {
// # Select all source alerts that are candidates for being inhibitors. All
// # supplied source filters have to match in order to select a source alert.
// source_filter: {
// name_re: "alertname"
// value_re: "JobDown"
// }
// source_filter: {
// name_re: "service"
// value_re: "api"
// }
//
// # Select all target alerts that are candidates for being inhibited. All
// # supplied target filters have to match in order to select a target alert.
// target_filter: {
// name_re: "alertname"
// value_re: "InstanceDown"
// }
// target_filter: {
// name_re: "service"
// value_re: "api"
// }
//
// # A target alert only actually inhibits a source alert if they match on
// # these labels. I.e. the alerts needs to fire for the same job in the same
// # zone for the inhibit to take effect between them.
// match_on: "job"
// match_on: "zone"
// }
//
// In this example, when JobDown is firing for
//
// JobDown{zone="aa",job="test",service="api"}
//
// ...it would inhibit an InstanceDown alert for
//
// InstanceDown{zone="aa",job="test",instance="1",service="api"}
//
// However, an InstanceDown alert for another zone:
//
// {zone="ab",job="test",instance="1",service="api"}
//
// ...would still fire.
message InhibitRule {
// The set of Filters which define the group of source alerts (which inhibit
// the target alerts).
repeated Filter source_filter = 1;
// The set of Filters which define the group of target alerts (which are
// inhibited by the source alerts).
repeated Filter target_filter = 2;
// A set of label names whose label values need to be identical in source and
// target alerts in order for the inhibition to take effect.
repeated string match_on = 3;
// How many seconds to wait for a corresponding inhibit source alert to
// appear before sending any notifications for active target alerts.
// TODO(julius): Not supported yet. Implement this!
// optional int32 before_allowance = 4 [default = 0];
// How many seconds to wait after a corresponding inhibit source alert
// disappears before sending any notifications for active target alerts.
// TODO(julius): Not supported yet. Implement this!
// optional int32 after_allowance = 5 [default = 0];
}
// Global alert manager configuration.
message AlertManagerConfig {
// Aggregation rule definitions.
repeated AggregationRule aggregation_rule = 1;
// Notification configuration definitions.
repeated NotificationConfig notification_config = 2;
// List of alert inhibition rules.
repeated InhibitRule inhibit_rule = 3;
}