mingzeh opened a new issue, #4256:
URL: https://github.com/apache/hertzbeat/issues/4256

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Current Behavior
   
   When I export a periodic alert rule, the exported file doesn't contain the 
query language (PromQL / SQL) I selected when creating the rule. Here is what I 
get:
   
   ```json
   
[{"alertDefine":{"name":"test","type":"periodic_metric","expr":"cpu_usage{instance=\"server1\"}
 > 
80","period":300,"times":3,"labels":{"severity":"critical"},"template":"test","enable":true}}]
   ```
   
   If I import this file back, the rule is created but its query language is 
empty, even though it is a required field when creating a rule in the UI. The 
rule doesn't work afterwards.
   
   <img width="2650" height="1654" alt="Image" 
src="https://github.com/user-attachments/assets/53447e68-dc68-4262-9f71-1bbe4fc29b8a";
 />
   
   ### Expected Behavior
   
   The exported file should contain the query language, and importing it should 
restore the rule exactly as it was.
   
   ### Steps To Reproduce
   
   1. Go to Alert -> Threshold, create a new rule with type "Periodic Alert" 
and query language "PromQL".
   2. Select the rule and export it (JSON / Excel).
   3. Open the exported file — the query language is not there.
   4. Import the file back and open the imported rule — the query language 
field is empty.
   
   ### Environment
   
   ```markdown
   HertzBeat version(s): v1.8.0
   ```
   
   ### Debug logs
   
   _No response_
   
   ### Anything else?
   
   Happens with all export formats, not only JSON.


-- 
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