【prometheus】alertmanager 配置文件示例
生活随笔
收集整理的這篇文章主要介紹了
【prometheus】alertmanager 配置文件示例
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
global:# The smarthost and SMTP sender used for mail notifications. 用于郵件通知的智能主機和SMTP發件人。smtp_smarthost: 'localhost:25'smtp_from: 'alertmanager@example.org'smtp_auth_username: 'alertmanager'smtp_auth_password: 'password'# The auth token for Hipchat. Hipchat的身份驗證令牌。hipchat_auth_token: '1234556789'# Alternative host for Hipchat.hipchat_api_url: 'https://hipchat.foobar.org/'# The directory from which notification templates are read. 從中讀取通知模板的目錄。
templates:
- '/etc/alertmanager/template/*.tmpl'# The root route on which each incoming alert enters. 每個傳入警報進入的根路由
route:# The labels by which incoming alerts are grouped together. For example,# multiple alerts coming in for cluster=A and alertname=LatencyHigh would# be batched into a single group.## To aggregate by all possible labels use '...' as the sole label name.# This effectively disables aggregation entirely, passing through all # alerts as-is. This is unlikely to be what you want, unless you have# a very low alert volume or your upstream notification system performs# its own grouping. Example: group_by: [...]# 傳入警報分組在一起的標簽。例如,群集= A和 alertname = LatencyHigh的多個警報將會出現被分成一組。# 要按所有可能的標簽聚合,請使用“...”作為唯一的標簽名稱。# 這有效地完全禁用了聚合,按原樣傳遞所有警報。這不太可能是您想要的,除非您的警報音量非常低或您的上游通知系統執行group_by: ['alertname', 'cluster', 'service']# When a new group of alerts is created by an incoming alert, wait at least 'group_wait' to send the initial notification.# 當傳入警報創建新的警報組時,至少等待'group_wait'發送初始通知。# This way ensures that you get multiple alerts for the same group that start firing shortly # after another are batched together on the first notification.# 這種方式可確保您為同一組獲得多個警報,這些警報會在第一個通知上另一個批處理后立即開始觸發group_wait: 30s# When the first notification was sent, wait 'group_interval' to send a batch# of new alerts that started firing for that group.# 發送第一個通知時,請等待'group_interval'發送一批為該組開始觸發的新警報。group_interval: 5m# If an alert has successfully been sent, wait 'repeat_interval' to resend them.# 如果已成功發送警報,請等待'repeat_interval'重新發送。repeat_interval: 3h # A default receiverreceiver: team-X-mails# All the above attributes are inherited by all child routes and can overwritten on each.# 所有上述屬性都由所有子路由繼承,并且可以在每個子路由上覆蓋。# The child route trees.routes:# This routes performs a regular expression match on alert labels to catch alerts that are related to a list of services.# 此路由在警報標簽上執行正則表達式匹配,以捕獲與服務列表相關的警報。- match_re:service: ^(foo1|foo2|baz)$receiver: team-X-mails# The service has a sub-route for critical alerts, any alerts that do not match, i.e. severity != critical, fall-back to the parent node and are sent to 'team-X-mails'# 該服務具有關鍵警報的子路由,任何不匹配的警報,即嚴重性!=嚴重,回退到父節點并發送到routes:- match:severity: criticalreceiver: team-X-pager- match:service: filesreceiver: team-Y-mailsroutes:- match:severity: criticalreceiver: team-Y-pager# This route handles all alerts coming from a database service. If there's no team to handle it, it defaults to the DB team.# 此路由處理來自數據庫服務的所有警報。如果沒有團隊可以處理它,則默認為數據庫團隊。- match:service: databasereceiver: team-DB-pager# Also group alerts by affected database.group_by: [alertname, cluster, database]routes:- match:owner: team-Xreceiver: team-X-pagercontinue: true- match:owner: team-Yreceiver: team-Y-pager# Inhibition rules allow to mute a set of alerts given that another alert is firing.
# 抑制規則允許在另一個警報觸發時靜音一組警報。
# We use this to mute any warning-level notifications if the same alert is already critical.
# 如果相同的警報已經很關鍵,我們使用它來靜音任何警告級別的通知。
inhibit_rules:
- source_match:severity: 'critical'target_match:severity: 'warning'# Apply inhibition if the alertname is the same. 如果警報名稱相同,則應用禁止。equal: ['alertname', 'cluster', 'service']receivers:
- name: 'team-X-mails'email_configs:- to: 'team-X+alerts@example.org'- name: 'team-X-pager'email_configs:- to: 'team-X+alerts-critical@example.org'pagerduty_configs:- service_key: <team-X-key>- name: 'team-Y-mails'email_configs:- to: 'team-Y+alerts@example.org'- name: 'team-Y-pager'pagerduty_configs:- service_key: <team-Y-key>- name: 'team-DB-pager'pagerduty_configs:- service_key: <team-DB-key>- name: 'team-X-hipchat'hipchat_configs:- auth_token: <auth_token>room_id: 85message_format: htmlnotify: true
原文鏈接:https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml
總結
以上是生活随笔為你收集整理的【prometheus】alertmanager 配置文件示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Docker】网络模式
- 下一篇: 【Docker】记一次docker co