-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
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
钉钉报警失效,不支持协议 #6
Comments
这个问题你是怎么解决的? |
我这边也报错:(只开启了飞书报警) |
注意app.conf文件中的其他配置项不需要的切勿删除,保留默认即可,删除了的话就会造成你上面的报错
…---原始邮件---
发件人: "python-it"<notifications@github.com>
发送时间: 2021年1月12日(周二) 下午3:34
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "Subscribed"<subscribed@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
我这边也报错:(只开启了飞书报警)
2021/01/12 07:25:05.105 [E] [prometheus.go:149] [1610436305105833601] [dingding] Post "": unsupported protocol scheme ""
2021/01/12 07:25:05.106 [C] [panic.go:969] the request url is /prometheus/alert
2021/01/12 07:25:05.106 [C] [panic.go:969] Handler crashed with error runtime error: invalid memory address or nil pointer dereference
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:969
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:212
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/signal_unix.go:717
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/dingding.go:71
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:149
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:67
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:460
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:321
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/vendor/github.com/astaxie/beego/router.go:853
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:2836
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:1924
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/asm_amd64.s:1373
2021/01/12 07:25:05.106 [server.go:3088] [HTTP] http: superfluous response.WriteHeader call from github.com/astaxie/beego/context.(*Response).WriteHeader (context.go:230)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
app.conf保持其他默认配置,还是报错了,只开启了飞书报警(prometheus-operator),求大佬指教,谢谢!
2021/01/12 09:47:15.194 [I] [prometheus.go:168] [1610444835107573678] [weixin] 企业微信接口未配置未开启状态,请先配置open-weixin为1
2021/01/12 09:47:15.194 [I] [feishu.go:32] [1610444835107573678] [feishu] {"title":"PrometheusAlert故障告警信息","text":"## [PrometheusAlertPrometheus故障告警信息](http://prometheus-k8s-0:9090/graph?g0.expr=kube_deployment_spec_replicas%7Bjob%3D%22kube-state-metrics%22%7D+%21%3D+kube_deployment_status_replicas_available%7Bjob%3D%22kube-state-metrics%22%7D\u0026g0.tab=1)\n\n#### [KubeDeploymentReplicasMismatch](http://alertmanager-main-0:9093)\n\n###### 告警级别:信息\n\n###### 开始时间:2021-01-12T09:47:05.095800493Z\n\n###### 结束时间:0001-01-01T00:00:00Z\n\n###### 故障主机IP:172.17.1.106:8443\n\n##### \n\n![PrometheusAlert](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)"}
2021/01/12 09:47:15.194 [E] [feishu.go:32] [1610444835107573678] [feishu] Post "": unsupported protocol scheme ""
2021/01/12 09:47:15.194 [C] [panic.go:969] the request url is /prometheus/alert
2021/01/12 09:47:15.194 [C] [panic.go:969] Handler crashed with error runtime error: invalid memory address or nil pointer dereference
2021/01/12 09:47:15.194 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:969
2021/01/12 09:47:15.194 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:212
2021/01/12 09:47:15.194 [C] [panic.go:969] /usr/local/go/src/runtime/signal_unix.go:717
2021/01/12 09:47:15.194 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/feishu.go:62
2021/01/12 09:47:15.194 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/feishu.go:32
2021/01/12 09:47:15.194 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:186
2021/01/12 09:47:15.195 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:67
2021/01/12 09:47:15.195 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:460
2021/01/12 09:47:15.195 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:321
2021/01/12 09:47:15.195 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/vendor/github.com/astaxie/beego/router.go:853
2021/01/12 09:47:15.195 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:2836
2021/01/12 09:47:15.195 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:1924
2021/01/12 09:47:15.195 [C] [panic.go:969] /usr/local/go/src/runtime/asm_amd64.s:1373
2021/01/12 09:47:15.195 [server.go:3088] [HTTP] http: superfluous response.WriteHeader call from github.com/astaxie/beego/context.(*Response).WriteHeader (context.go:230)
…------------------ 原始邮件 ------------------
发件人: "feiyu563/PrometheusAlert" <notifications@github.com>;
发送时间: 2021年1月12日(星期二) 下午4:55
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "暴戾ing"<164859527@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
注意app.conf文件中的其他配置项不需要的切勿删除,保留默认即可,删除了的话就会造成你上面的报错
---原始邮件---
发件人: "python-it"<notifications@github.com&gt;
发送时间: 2021年1月12日(周二) 下午3:34
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com&gt;;
抄送: "Subscribed"<subscribed@noreply.github.com&gt;;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
我这边也报错:(只开启了飞书报警)
2021/01/12 07:25:05.105 [E] [prometheus.go:149] [1610436305105833601] [dingding] Post "": unsupported protocol scheme ""
2021/01/12 07:25:05.106 [C] [panic.go:969] the request url is /prometheus/alert
2021/01/12 07:25:05.106 [C] [panic.go:969] Handler crashed with error runtime error: invalid memory address or nil pointer dereference
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:969
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/panic.go:212
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/signal_unix.go:717
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/dingding.go:71
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:149
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/controllers/prometheus.go:67
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:460
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/reflect/value.go:321
2021/01/12 07:25:05.106 [C] [panic.go:969] /go/src/github.com/feiyu563/PrometheusAlert/vendor/github.com/astaxie/beego/router.go:853
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:2836
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/net/http/server.go:1924
2021/01/12 07:25:05.106 [C] [panic.go:969] /usr/local/go/src/runtime/asm_amd64.s:1373
2021/01/12 07:25:05.106 [server.go:3088] [HTTP] http: superfluous response.WriteHeader call from github.com/astaxie/beego/context.(*Response).WriteHeader (context.go:230)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
你的配置文件贴下我看看 |
apiVersion: v1
|
飞书的配置项名称是fsurl,新的版本已经没有fsv2url这个配置项了 |
飞书报警已调试成功,还有就是模板匹配问题,目前告警模板不能显示pod,namespace等信息,配置如下:
报警模板: |
感觉是模板没有生效 |
使用自定义模板需要配合用 /prometheusalert 自定义模板的接口才能生效
…---原始邮件---
发件人: "python-it"<notifications@github.com>
发送时间: 2021年1月13日(周三) 中午11:08
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "feiyu563"<244217140@qq.com>;"State change"<state_change@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
飞书报警已调试成功,还有就是模板匹配问题,目前告警模板不能显示pod,namespace等信息,配置如下:
报警规则:
name: kubernetes-system-apiserver
rules:
alert: KubeAPILatencyHigh
annotations:
message: The API server has a 99th percentile latency of {{ $value }} seconds
for {{ $labels.verb }} {{ $labels.resource }}.
runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeapilatencyhigh
expr: |
cluster_quantile:apiserver_request_duration_seconds:histogram_quantile{job="apiserver",quantile="0.99",subresource!="log",verb!~"LIST|WATCH|WATCHLIST|PROXY|CONNECT"} > 1
for: 10m
labels:
severity: warning
alert: KubeAPILatencyHigh
annotations:
message: The API server has a 99th percentile latency of {{ $value }} seconds
for {{ $labels.verb }} {{ $labels.resource }}.
runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeapilatencyhigh
expr: |
cluster_quantile:apiserver_request_duration_seconds:histogram_quantile{job="apiserver",quantile="0.99",subresource!="log",verb!~"LIST|WATCH|WATCHLIST|PROXY|CONNECT"} > 4
for: 10m
labels:
severity: critical
报警模板:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
Prometheus恢复信息
{{$v.labels.alertname}}
告警级别:{{$v.labels.severity}}
告警namespace:{{$v.labels.namespace}}
告警pod:{{$v.labels.pod}}
告警内容:{{$v.annotations.message}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}
{{else}}
Prometheus告警信息
{{$v.labels.alertname}}
告警级别:{{$v.labels.severity}}
告警namespace:{{$v.labels.namespace}}
告警pod:{{$v.labels.pod}}
告警内容:{{$v.annotations.message}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}
{{end}}
{{ end }}
报警结果:
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
我说的是你的alertmanager的里面配置的那个URL,参考这个使用 |
直接报警都不通了:
报错如下: |
仔细看文档,地址写的不对
…---原始邮件---
发件人: "python-it"<notifications@github.com>
发送时间: 2021年1月13日(周三) 中午12:01
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "feiyu563"<244217140@qq.com>;"State change"<state_change@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
直接报警都不通了:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 10s
group_interval: 5m
repeat_interval: 12h
receiver: webhook
receivers:
name: 'webhook'
webhook_configs:
url: 'http://prometheus-alert-center.monitoring.svc.cluster.local:8080/prometheusalert'
send_resolved: true
报错如下:
kubectl logs prometheus-alert-center-564c49fccd-mwcnt pod -n monitoring
error: container pod is not valid for pod prometheus-alert-center-564c49fccd-mwcnt
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
终于找对地址了 |
问题现象:我配置了prometheus-alert的飞书报警和非prometheus-alert项目的钉钉报警,飞书报警会延迟10分钟才会发消息至飞书机器人,配置如下:
|
你试着把飞书的配置放前面
…---原始邮件---
发件人: "python-it"<notifications@github.com>
发送时间: 2021年1月14日(周四) 下午4:35
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "feiyu563"<244217140@qq.com>;"State change"<state_change@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
问题现象:我配置了prometheus-alert的飞书报警和非prometheus-alert项目的钉钉报警,飞书报警会延迟10分钟才会发消息至飞书机器人,配置如下:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 3s
group_interval: 5s
repeat_interval: 1h
receiver: webhook
receivers:
name: 'webhook'
webhook_configs:
url: 'http://webhook-dingtalk.monitoring.svc.cluster.local:8060/dingtalk/default-webhook-dingtalk/send'
send_resolved: true
url: 'http://prometheus-alert-center.monitoring.svc.cluster.local:8080/prometheusalert?type=fs&tpl=prometheus-fs&fsurl=https://open.feishu.cn/open-apis/bot/v2/hook/3b263649-92d3-4a9a-a4d7-xxxxxxx'
send_resolved: true
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
确实先后顺序的问题,这个能配置同时发送吗?大佬 |
可以,改下你的alertmanager的配置就行
…---原始邮件---
发件人: "python-it"<notifications@github.com>
发送时间: 2021年1月14日(周四) 下午4:54
收件人: "feiyu563/PrometheusAlert"<PrometheusAlert@noreply.github.com>;
抄送: "feiyu563"<244217140@qq.com>;"State change"<state_change@noreply.github.com>;
主题: Re: [feiyu563/PrometheusAlert] 钉钉报警失效,不支持协议 (#6)
确实先后顺序的问题,这个能配置同时发送吗?大佬
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
钉钉报警没效果,我看了打印的日志
PostToDingDing:Post : unsupported protocol scheme ""
app.conf
The text was updated successfully, but these errors were encountered: