bigcyy commented on code in PR #3673:
URL: https://github.com/apache/hertzbeat/pull/3673#discussion_r2300915802
##########
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:
>Then I looked at the code you discussed for this position. As I understand
it, you should first perform a QueryExpr query, then use expr to perform JEXL
threshold matching. Wouldn't this be a bit complicated? I'm also concerned that
there might be a performance bottleneck when executing a large number of
complex JEXL expressions.
I believe this is unavoidable. We can, however, add expression caching or
SQL result set caching to improve performance.
##########
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:
Furthermore, when coupling SQL with a threshold expression, the SQL result
must be a single column; a multi-column result set cannot be processed. For
example, if I need to count the number of logs for each log level of every web
service within 30 seconds, and this SQL is coupled with a threshold expression,
the result will only contain the log count column. This leads to a loss of
critical information, such as which services and which log levels the logs
belong to.
--
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]