我试图使用Alertmanager的配置来控制PagerDuty警报的严重级别。
我在Alertmanager的接收端将severity级别硬编码为warning:
- name: 'whatever_pd_service'
pagerduty_configs:
- send_resolved: true
service_key: SERVICE_KEY
url: https://events.pagerduty.com/v2/enqueue
client: '{{ template "pagerduty.default.client" . }}'
client_url: '{{ template "pagerduty.default.clientURL" . }}'
severity: 'warning'
description: '{{ (index .Alerts 0).Annotations.summary }}'
details:
firing: '{{ template "pagerduty.default.instances" .Alerts.Firing }}'
information: '{{ range .Alerts }}{{ .Annotations.information }}
{{ end }}'
num_firing: '{{ .Alerts.Firing | len }}'
num_resolved: '{{ .Alerts.Resolved | len }}'
resolved: '{{ template "pagerduty.default.instances" .Alerts.Resolved }}'但是,在生成的警报中,Severity级别被设置为critical:

有办法在Severity中设置PagerDuty级别吗?
发布于 2022-07-13 23:39:17
找出了Alertmanager接收机配置中的severity字段不能工作的原因--我们在PagerDuty服务中使用了Prometheus (Events API v1)集成,并且根据PD事件API v1 (https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTc4-send-a-v1-event)的规范,没有severity字段。
因此有两种方法可以解决这个问题(为PagerDuty实现动态通知)--要么使用Events API v2,要么使用服务编排(https://support.pagerduty.com/docs/event-orchestration#service-orchestrations)。
https://stackoverflow.com/questions/72734127
复制相似问题