【问题标题】:Alertmanager Send Resolved to a separate channelAlertmanager Send Resolved 到一个单独的通道
【发布时间】:2020-07-16 18:05:35
【问题描述】:

我们已经为我们的系统配置了基于 Prometheus 的警报,它运行良好。警报将发送到 Slack 和 Teams 中的特定渠道。为了生成票证和自动关闭票证(在已解决的消息上),我们为一个警报发送已解决状态。现在,支持人员正在查看主要松弛通道中的警报,他们不想在那里收到已解决的通知(主要用于自动关闭工单)。有什么方法可以将已解决的通知发送到另一个频道,而不是它发布警报的频道?

这是配置的摘录

    - match_re:
        component: 'platform'
      receiver: 'slack-notifications-platform'
      continue: false

- name: 'slack-notifications-platform'
  slack_configs:
  - send_resolved: true
    api_url: 'https://hooks.slack.com/services/T091V/B8UHDTR/hfY66GDhwvRD5myKbZ88cva'
    channel: '#telemetry_alerts_ops'
    color: '{{ if eq .Status "resolved" }}good{{ else }}{{ if eq .CommonLabels.severity "minor"}}warning{{ else }}danger{{ end }}{{ end }}'
    title: '{{ if gt (.Alerts.Firing | len) 0 }}[FIRING: {{ .Alerts.Firing | len }}]{{ end }}{{ if gt (.Alerts.Resolved | len) 0 }}[RESOLVED: {{ .Alerts.Resolved | len }}]{{ end }}{{ .GroupLabels.alertname }} ({{ .CommonLabels.severity }})'
    text: '{{ template "slack.common.text" . }}'

【问题讨论】:

    标签: prometheus prometheus-alertmanager


    【解决方案1】:

    您可以通过将其发送到两个通道并仅在其中一个通道中将 send_resolved 设置为 true 来破解它。

    两个频道仍会以这种方式收到警报,但只有一个会收到解析。

    您需要在路由上使用continue 选项,以便将警报发送到两条路由。

    文档:https://prometheus.io/docs/alerting/latest/configuration/#route

    【讨论】:

      猜你喜欢
      • 2020-10-21
      • 1970-01-01
      • 2021-04-14
      • 2013-06-06
      • 2013-08-01
      • 1970-01-01
      • 2020-01-10
      • 2017-07-04
      • 1970-01-01
      相关资源
      最近更新 更多