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