我不知道如何运行 alertmanager.yml 以与 opsgenie 集成。我应该在终端使用什么命令才能使其运行?我试过k create -f alertmanager.yml
了,但它显示:
error: error validating "alertmanager.yml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
这是我的 alertmanager.yml,有什么建议吗?
global:
resolve_timeout: 1m
opsgenie_api_url: https://api.opsgenie.com/
opsgenie_api_key: <my_opsgenie_key>
receivers:
- opsgenie_configs:
- teams: test_escalation
priority: '{{ range .Alerts }}{{ if eq .Labels.severity "critical"}}P1{{else if eq .Labels.severity "warning"}}P2{{else if eq .Labels.severity "info"}}P3{{else}}P4{{end}}{{end}}'
name: opsgenie
route:
group_by: ['...']
receiver: opsgenie
repeat_interval: 5m