Skip to content

Commit

Permalink
[ResponseOps] Add user-error tags to action logs (elastic#193066)
Browse files Browse the repository at this point in the history
Resolves elastic#192715

## Summary

Adds user-error and framework-error tags to the action error logs


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
  • Loading branch information
doakalexi authored Sep 17, 2024
1 parent 0fc191a commit e47eff1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/actions/server/lib/action_executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ describe('Action Executor', () => {
);
expect(loggerMock.error).toBeCalledWith(err, {
error: { stack_trace: 'foo error\n stack 1\n stack 2\n stack 3' },
tags: ['test', '1', 'action-run-failed'],
tags: ['test', '1', 'action-run-failed', 'framework-error'],
});
});

Expand Down Expand Up @@ -1274,7 +1274,7 @@ describe('Action Executor', () => {
);
expect(loggerMock.error).toBeCalledWith(err, {
error: { stack_trace: 'foo error\n stack 1\n stack 2\n stack 3' },
tags: ['test', '1', 'action-run-failed'],
tags: ['test', '1', 'action-run-failed', 'user-error'],
});
});

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/lib/action_executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export class ActionExecutor {
event.error.message = actionErrorToMessage(result);
if (result.error) {
logger.error(result.error, {
tags: [actionTypeId, actionId, 'action-run-failed'],
tags: [actionTypeId, actionId, 'action-run-failed', `${result.errorSource}-error`],
error: { stack_trace: result.error.stack },
});
}
Expand Down

0 comments on commit e47eff1

Please sign in to comment.