forked from prometheus/alertmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.proto
149 lines (140 loc) · 5.36 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
// 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;
}
// Configuration for notification via pushover.net.
message PushoverConfig {
// Pushover token
optional string token = 1;
// Pushover user_key
optional string user_key = 2;
}
// 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;
}
// 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;
}