-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event log shows a failure when ruleResultService.addLastRunError adds an error #179551
Event log shows a failure when ruleResultService.addLastRunError adds an error #179551
Conversation
/ci |
/ci |
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
We should really add a function test for this, but I understand we're in a bit of a crunch - if that's too much for now, let's open an issue to add one. |
Everything looks good here, except I'm seeing the TM metrics show an error from the rule I instrumented, to show up as a USER error, not framework: "alerting:__index-threshold": {
"success": 0,
"not_timed_out": 44,
"total": 44,
"total_errors": 44,
"user_errors": 44,
"framework_errors": 0
}, I instrumented index threshold rule by adding a update: this is expected. The code to set the user to be framework is only when they added the addLastRunError, but didn't actually throw an error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, beyond adding a function test (via separate issue is fine).
Tested with the scenario described in the referenced issue, as well as an instrumented executor that explicitly throws errors - works as expected both way ...
Created a PR to align the error types: #179656 |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @ersin-erdal |
Resolves: #174035
As the new
lastRun
status holder for rule execution can set the outcome of a successful execution asfailed
We have to do the same for the old
executionStatus
as well.This PR, sets rule execution status as
error
when there are error messages reported by theruleResultService.addLastRunError
, even if no errors are thrown!So the event-log and task metrics shows the correct results.
To verify
Please follow the steps in the issue to reproduce.