-
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
Add user-error and framework-error tags to task manager run failure logs #199346
Closed
2 tasks done
Labels
Feature:Task Manager
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Comments
mikecote
added
Feature:Task Manager
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
labels
Nov 7, 2024
Pinging @elastic/response-ops (Team:ResponseOps) |
mikecote
changed the title
Add user_error and framework_error tags to task manager run failure logs
Add user-error and framework-error tags to task manager run failure logs
Nov 8, 2024
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Nov 13, 2024
) Resolves elastic#199346 In this PR I'm adding `user-error` and `framework-error` tags to the associated task failure logs. ## To verify You can either use the jest test to observe the returned flags or set your logging to JSON and use the following code samples to test various types of errors. kibana.yml to set logging to JSON ``` logging: appenders: json-layout: type: console layout: type: json root: appenders: [json-layout] ``` Code samples throwing various types of errors. ``` diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 89432e18220..129b53f71b4 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -649,6 +649,10 @@ export class TaskRunner< schedule: taskSchedule, } = this.taskInstance; + // throw createTaskRunError(new Error('foo'), TaskErrorSource.USER); + // throw createTaskRunError(new Error('foo'), TaskErrorSource.FRAMEWORK); + // throw new Error('foo'); + this.logger = createTaskRunnerLogger({ logger: this.logger, tags: [ruleId, this.ruleType.id] }); let stateWithMetrics: Result<RuleTaskStateAndMetrics, Error>; ``` (cherry picked from commit 544525d)
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this issue
Nov 18, 2024
) Resolves elastic#199346 In this PR I'm adding `user-error` and `framework-error` tags to the associated task failure logs. ## To verify You can either use the jest test to observe the returned flags or set your logging to JSON and use the following code samples to test various types of errors. kibana.yml to set logging to JSON ``` logging: appenders: json-layout: type: console layout: type: json root: appenders: [json-layout] ``` Code samples throwing various types of errors. ``` diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 89432e18220..129b53f71b4 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -649,6 +649,10 @@ export class TaskRunner< schedule: taskSchedule, } = this.taskInstance; + // throw createTaskRunError(new Error('foo'), TaskErrorSource.USER); + // throw createTaskRunError(new Error('foo'), TaskErrorSource.FRAMEWORK); + // throw new Error('foo'); + this.logger = createTaskRunnerLogger({ logger: this.logger, tags: [ruleId, this.ruleType.id] }); let stateWithMetrics: Result<RuleTaskStateAndMetrics, Error>; ```
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this issue
Nov 18, 2024
) Resolves elastic#199346 In this PR I'm adding `user-error` and `framework-error` tags to the associated task failure logs. ## To verify You can either use the jest test to observe the returned flags or set your logging to JSON and use the following code samples to test various types of errors. kibana.yml to set logging to JSON ``` logging: appenders: json-layout: type: console layout: type: json root: appenders: [json-layout] ``` Code samples throwing various types of errors. ``` diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 89432e18220..129b53f71b4 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -649,6 +649,10 @@ export class TaskRunner< schedule: taskSchedule, } = this.taskInstance; + // throw createTaskRunError(new Error('foo'), TaskErrorSource.USER); + // throw createTaskRunError(new Error('foo'), TaskErrorSource.FRAMEWORK); + // throw new Error('foo'); + this.logger = createTaskRunnerLogger({ logger: this.logger, tags: [ruleId, this.ruleType.id] }); let stateWithMetrics: Result<RuleTaskStateAndMetrics, Error>; ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature:Task Manager
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Similar to how we tag alerting rule run failures and connector run failures, we should either add the
user-error
orframework-error
tag whenever logging a task run failure.Definition of Done
user-error
orframework-error
tag included whenever task manager logs a task run failure with thetask-run-failed
tagThe text was updated successfully, but these errors were encountered: