You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过AWS Workspaces配置EKS集群Prometheus Alertmanager报错如何解决

问题根因与可行解决方案

核心报错原因

1. 功能限制不匹配

当前Amazon托管Prometheus(AMP)的Alertmanager服务原生仅支持SNS作为告警接收端,不支持直接配置slack_configs等原生Alertmanager的其他接收器类型,不符合AMP配置规范是触发格式错误的主要原因。

2. YAML语法本身存在错误

你提供的配置即使在原生Alertmanager环境中也无法正常加载:

  • slack_configs下的- api_url行缩进错误,比上级字段slack_configs层级还高
  • 抑制规则的equal字段中存在拼写错误:instasnce应为instance

可行配置方案

必须按官方要求走SNS+Lambda的链路实现Slack告警,步骤如下:

  1. 先调整Alertmanager配置为SNS接收器格式,可通过AMP校验:
alertmanager_config: |
  route:
    group_by: ['alertname']
    group_wait: 10s
    group_interval: 10s
    repeat_interval: 1m
    receiver: 'sns_receiver'
  receivers:
    - name: 'sns_receiver'
      sns_configs:
      - topic_arn: 'arn:aws:sns:<你的AWS区域>:<你的AWS账号ID>:<你创建的SNS主题名称>'
        send_resolved: true
  inhibit_rules:
    - source_match:
        severity: 'critical'
      target_match:
        severity: 'warning'
      equal: ['alertname', 'dev', 'instance']
  1. 创建Lambda函数,解析SNS接收到的AMP告警 payload,按照Slack webhook要求的格式拼接消息后发送到你的Slack webhook地址。
  2. 为SNS主题配置权限,允许AMP服务主体向该主题发布消息,权限策略参考:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "aps.amazonaws.com"
      },
      "Action": "sns:Publish",
      "Resource": "arn:aws:sns:<你的AWS区域>:<你的AWS账号ID>:<你创建的SNS主题名称>"
    }
  ]
}

目前没有绕过SNS直接配置Slack接收器的方案,必须按上述链路实现需求。

内容的提问来源于stack exchange,提问作者Vlatko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.29 22:06:04