From e47eff12204885a2c280d07e42fb8a96fa61c778 Mon Sep 17 00:00:00 2001 From: Alexi Doak <109488926+doakalexi@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:31:11 -0700 Subject: [PATCH] [ResponseOps] Add user-error tags to action logs (#193066) Resolves https://github.com/elastic/kibana/issues/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 --- x-pack/plugins/actions/server/lib/action_executor.test.ts | 4 ++-- x-pack/plugins/actions/server/lib/action_executor.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index 560d5dc3ecea5..6e4ec1b69c876 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -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'], }); }); @@ -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'], }); }); diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index 4a0b51954ba1d..a636f4b41566c 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -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 }, }); }