tomsun28 commented on code in PR #3673:
URL: https://github.com/apache/hertzbeat/pull/3673#discussion_r2301561498
##########
hertzbeat-common/src/main/java/org/apache/hertzbeat/common/entity/alerter/AlertDefine.java:
##########
@@ -100,6 +100,11 @@ public class AlertDefine {
@Size(max = 100)
private String datasource;
+ @Schema(title = "Query Expression", example = "SELECT * FROM metrics WHERE
value > 90")
+ @Size(max = 2048)
+ @Column(length = 2048)
+ private String queryExpr;
+
Review Comment:
I wonder if we are using JEXL here, which leads to the separation of the two
expressions now. What if the SQL query itself is an expression judgment? I see
that some platforms do this.
> For example, if I need to count the number of logs for each log level of
every web service within 30 seconds which number is > 20.
For this, the sql expr is
```
SELECT
service_name,
log_level,
COUNT(*) AS log_count
FROM logs
WHERE timestamp >= NOW() - INTERVAL '30' SECOND
GROUP BY service_name, log_level
HAVING COUNT(*) > 20;
```
That we do not need other expr to condition. Also it can render the filter
data UI.
--
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]