love01211 commented on issue #3773:
URL: https://github.com/apache/hertzbeat/issues/3773#issuecomment-3311566233

   ok
   
   
   > > > > [@Duansg](https://github.com/Duansg) I think I've found the pattern: 
after configuring the alert rules, the backend error logs will show an error:
   > > > > ```
   > > > > 2025-09-18 17:28:43.236 [http-nio-1157-exec-8] ERROR 
org.apache.hertzbeat.alert.calculate.PeriodicAlertRuleScheduler Line:75  - 
Alert rule is null or rule id is null.
   > > > > ```
   > > > > 
   > > > > 
   > > > >     
   > > > >       
   > > > >     
   > > > > 
   > > > >       
   > > > >     
   > > > > 
   > > > >     
   > > > >   
   > > > > Then, after waiting for 30 minutes, the first error message appears: 
"Calculate query parse error promql: Expression is not fully parsed, may have 
syntax errors or incomplete inputs."
   > > > > <img alt="Image" width="2000" height="666" 
src="https://private-user-images.githubusercontent.com/31766073/491035997-89723312-de09-493d-b291-5fb6ca5219c7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTgyMDk2MDcsIm5iZiI6MTc1ODIwOTMwNywicGF0aCI6Ii8zMTc2NjA3My80OTEwMzU5OTctODk3MjMzMTItZGUwOS00OTNkLWIyOTEtNWZiNmNhNTIxOWM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA5MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwOTE4VDE1MjgyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjODJkMWFhODA2YWM1MmFlZWY3YzcyZmFkODNhNDBlNWRhYzk2NjAyMmZiOGI3NTgwZWFmYTY2ZmEyM2UyMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cPyuSpgJOKw5mGPGscK-o3Rz4a1yzD9BaxE-cT33fi0";>
   > > > 
   > > > 
   > > > [@love01211](https://github.com/love01211) Hi, thank you for your 
assistance and response. that's odd.
   > > > The purpose of this exception is to verify whether the expression has 
been fully consumed and to check for invalid expressions. However, the 
expression you provided appears to be parsed correctly.
   > > > Could you please export the data from `hzb_alert_define` to facilitate 
our further troubleshooting?
   > > 
   > > 
   > > Of course,I just modified the alert rule., here is the SQL insert 
statement.`select * from hzb_alert_define where type = 'periodic'`
   > > INSERT INTO "public"."hzb_alert_define" ("id", "annotations", "creator", 
"datasource", "enable", "expr", "gmt_create", "gmt_update", "labels", 
"modifier", "name", "period", "template", "times", "type") VALUES (7, NULL, 
'admin', 'promql', 't', 'cpu_usage == 0', '2025-09-18 17:28:43.229194', 
'2025-09-18 17:30:18.085477', '{"severity":"warning"}', 'admin', '测试cpu告警', 60, 
'${instance}(${host})cpu告警', 1, 'periodic');
   > 
   > Hi, [@love01211](https://github.com/love01211) . I'm very sorry, i tried 
it again but still couldn't reproduce the issue. However, I suspect this error 
isn't caused by the threshold expression you provided. I'll submit a PR shortly 
that addresses the following:
   > 
   > 1. Resolve the issue `Alert rule is null or rule id is null.`
   > 2. Add exception logging to obtain the threshold expression for errors.
   > 
   > You can build according to the contents of this PR and review the specific 
error details.
   
   Ok, but I'm not a professional developer. I'll try to conduct tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to