taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.28k stars 4.84k forks source link

When the end time of the warning message triggered by TDengine-alert is greater than the start time,alertmanage fails to send the message #4191

Closed kejianchan closed 3 years ago

kejianchan commented 3 years ago

alert.log

{"startsAt":"2020-11-11T17:25:00.172781901+08:00","endsAt":"2020-11-11T17:16:00.173373519+08:00","values":{"diff_c":288,"ts":"2020-11-11 17:23:00.0"},"labels":{"ruleName":"Test"},"annotations":{"summary":"1分钟设备离线数288"}}

alertmanage日志

level=error ts=2020-11-11T08:50:00.270Z caller=api.go:780 component=api version=v1 msg="API error" err="bad_data: start time must be before end time"
level=error ts=2020-11-11T09:01:00.271Z caller=api.go:780 component=api version=v1 msg="API error" err="bad_data: start time must be before end time"
level=error ts=2020-11-11T09:15:10.437Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="webhook/webhook[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: http://192.168.0.163:8060/dingtalk/webhook1/send"
level=error ts=2020-11-11T09:25:00.272Z caller=api.go:780 component=api version=v1 msg="API error" err="bad_data: start time must be before end time"
localvar commented 3 years ago

when endsAt is invalid, it is "0000-00-00T00:00:00" now.