alertmanager/config/config.proto

140 lines
5.1 KiB
Protocol Buffer

// 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;
}
// 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;
}
// 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;
}