We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我的配置文件如下:
[root@master-ops-1 prometheus-webhook-dingtalk-1.4.0.linux-amd64]# cat config.yml timeout: 5s templates: - contrib/templates/legacy/template.tmpl targets: ops: url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxx mention: all: true
启动结果:
[root@master-ops-1 prometheus-webhook-dingtalk-1.4.0.linux-amd64]# ./prometheus-webhook-dingtalk --web.listen-address=":8060" --web.enable-ui --config.file="./config.yml" --web.enable-lifecycle --log.format=json {"caller":"main.go:62","level":"info","msg":"Starting prometheus-webhook-dingtalk","ts":"2020-09-01T06:22:07.646Z","version":"(version=1.4.0, branch=HEAD, revision=02fe8265a98ab4caaa78ebbed209d3f06b87b4a6)"} {"(go=go1.13.5, user=root@eb9f8d8f0437, date=20191211-03:00:38)":"(MISSING)","caller":"main.go:63","level":"info","msg":"Build context","ts":"2020-09-01T06:22:07.646Z"} {"caller":"coordinator.go:89","component":"configuration","file":"./config.yml","level":"info","msg":"Loading configuration file","ts":"2020-09-01T06:22:07.646Z"} {"caller":"coordinator.go:97","component":"configuration","file":"./config.yml","level":"info","msg":"Completed loading of configuration file","ts":"2020-09-01T06:22:07.647Z"} {"caller":"main.go:117","component":"configuration","level":"info","msg":"Loading templates","templates":"contrib/templates/legacy/template.tmpl","ts":"2020-09-01T06:22:07.647Z"} {"caller":"main.go:133","component":"configuration","msg":"Webhook urls for prometheus alertmanager","ts":"2020-09-01T06:22:07.647Z","urls":"http://localhost:8060/dingtalk/ops/send"} {"address":":8060","caller":"web.go:210","component":"web","level":"info","msg":"Start listening for connections","ts":"2020-09-01T06:22:07.648Z"}
用于请求测试的json文件
[root@master-ops-1 prometheus-webhook-dingtalk-1.4.0.linux-amd64]# cat text.json { "receiver": "admins", "status": "firing", "alerts": [ { "status": "firing", "labels": { "alertname": "something_happened", "env": "prod", "instance": "server01.int:9100", "job": "node", "service": "prometheus_bot", "severity": "warning", "supervisor": "runit" }, "annotations": { "summary": "Oops, something happened!" }, "startsAt": "2016-04-27T20:46:37.903Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "https://example.com/graph#..." }, { "status": "firing", "labels": { "alertname": "something_happened", "env": "staging", "instance": "server02.int:9100", "job": "node", "service": "prometheus_bot", "severity": "warning", "supervisor": "runit" }, "annotations": { "summary": "Oops, something happend!" }, "startsAt": "2016-04-27T20:49:37.903Z", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "https://example.com/graph#..." } ], "groupLabels": { "alertname": "something_happened", "instance": "server01.int:9100" }, "commonLabels": { "alertname": "something_happened", "job": "node", "service": "prometheus_bot", "severity": "warning", "supervisor": "runit" }, "commonAnnotations": { "summary": "runit service prometheus_bot restarted, server01.int:9100" }, "externalURL": "https://alert-manager.example.com", "version": "3" }
请求测试 [root@master-ops-1 prometheus-webhook-dingtalk-1.4.0.linux-amd64]# curl -XPOST http://localhost:8060/dingtalk/ops/send -d "$(cat text.json)" OK
查看钉钉
The text was updated successfully, but these errors were encountered:
试了很久,最终在 #35 里得知只支持text格式,markdown不行
Sorry, something went wrong.
No branches or pull requests
我在配置文件中定义了 mention.all=true,但是消息并没有@所有人?
The text was updated successfully, but these errors were encountered: