alertmanager 0.25 将已解决的消息作为原始警报消息的线程发送

问题描述 投票:0回答:1

我正在使用带有 slack webhook 的 Alertmanager 0.25,尝试将我的解析消息作为发送到 slack 通道的原始警报的线程。

根据文档和chatgpt,下面的模板应该可以工作,但是我的alertmanager容器无法启动(不断重新启动)并出现以下错误:

{"caller":"coordinator.go:118","component":"configuration","err":"yaml: unmarshal errors:\n  line 119: field thread_ts not found in type config.plain\n  line 131: field thread_ts not found in type config.plain\n  line 160: field thread_ts not found in type config.plain\n  line 171: field thread_ts not found in type config.plain\n  line 182: field thread_ts not found in type config.plain\n  line 194: field thread_ts not found in type config.plain\n  line 245: field thread_ts not found in type config.plain","file":"/etc/alertmanager/alertmanager.yml","level":"error","msg":"Loading configuration file failed","ts":"2023-02-12T10:06:21.586Z"}

我的警报管理器配置如下所示:

- name: "default-alerts-test"
    slack_configs:
      - api_url: 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXX'
        send_resolved: true
        thread_ts: "{{ .Annotations.thread_ts }}"
        http_config: {}
        icon_emoji: ':this-is-fine-fire:'
        channel: '#monitoring-alerts'
        title: "{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}"
        text: "{{ .Annotations.summary }}\n{{ .Annotations.description }}\nGroup Key: {{ .Labels.group_key }}"
        callback_id: '{{ template "slack.default.callbackid" . }}'

没有

thread_ts
我的配置工作正常,并且我正在向我提醒的同一频道发送解析消息,因此这不是身份验证或授权问题。

据我了解,

thread_ts
参数是在0.22版本中实现的,那么我在这里缺少什么?

slack-api prometheus-alertmanager
1个回答
0
投票

根据此链接alertManager_slackReciver

没有办法, 减少对 ChatGPT 的依赖

© www.soinside.com 2019 - 2024. All rights reserved.