Replies: 1 comment 11 replies
-
9.4 is too old, some old versions don't support MAL metrics for alerting. I believe the 10.0.1 works for that, and the alerting kernel has been upgraded to use MQE. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I implemented the lal and mal and the log metric also can be displayed in widget, but when i add the error count alerting rule, it always failed and cant trigger the condition.
So please see the following detail and help to check which place is not correct. thank you.
The lal file as below and it works:
`rules:
layer: GENERAL
dsl: |
filter {
text {
abortOnFailure true
regexp "(?\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) \[TID:(?.+?)] \[(?.+?)] (?\w{4,})"
}
extractor {
metrics {
timestamp log.timestamp as Long
labels level: parsed.level, service: log.service, instance: log.serviceInstance
name "log_count"
value 1
}
}
sink {
if (parsed.level == "INFO") {
enforcer { }
}
if (parsed.level == "ERROR") {
enforcer { }
}
if (parsed.level == "WARN") {
enforcer { }
}
}
}`
The mal file as below and it works
`expSuffix: instance(['service'], ['instance'], Layer.GENERAL)
metricPrefix: log
metricsRules:
exp: log_count.tagEqual('level', 'INFO').sum(['service', 'instance']).downsampling(SUM)
exp: log_count.tagEqual('level', 'WARN').sum(['service', 'instance']).downsampling(SUM)
exp: log_count.tagEqual('level', 'ERROR').sum(['service', 'instance']).downsampling(SUM)
exp: log_count.tagEqual('level', 'ERROR').sum(['service', 'instance']).downsampling(SUM).increase('PT1M')`
The alerting rule segment as below but it not works:
log_count_error_rule: metrics-name: log_count_error #expression: sum(log_count_error) op: ">" threshold: 1 #period: 1 tags: level: WARNING #count: 2 #silence-period: 5 message: The error logs are more than 5 in latest ten minutes, please have a look
The metric graph in service instance as below:
Please help to check what`s the problem, thank you again.
Beta Was this translation helpful? Give feedback.
All reactions