[GH-ISSUE #153] Record the error info for failed task #733

Closed
opened 2026-03-15 21:23:09 +03:00 by kerem · 3 comments
Owner

Originally created by @lufishggg on GitHub (Sep 12, 2021).
Original GitHub issue: https://github.com/hibiken/asynqmon/issues/153

Maybe we can record the error info for failed task which is good for debugging and online monitoring

Originally created by @lufishggg on GitHub (Sep 12, 2021). Original GitHub issue: https://github.com/hibiken/asynqmon/issues/153 Maybe we can record the error info for failed task which is good for debugging and online monitoring
kerem closed this issue 2026-03-15 21:23:14 +03:00
Author
Owner

@hibiken commented on GitHub (Sep 12, 2021):

@lufishggg thank you for opening an issue!

Currently, asynq stores the error message from the last failure (if any) and this is shown in the WebUI.
If you need more error info (e.g. entire error history not just the last one, stack trace, etc) and for monitoring/alerting you can probably use an error reporting service (e.g. Bugsnag, Rollbar, Sentry, Airbrake, etc).
Asynq provides ErrorHandler via config so you can report all errors to a error reporting service using this hook:

func reportError(ctx context, task *asynq.Task, err error) {
     // notify error to the error reporting service
}

srv := asynq.NewServer(redisConnOpt, asynq.Config{
     ErrorHandler: asynq.ErrorHandlerFunc(reportError),
})
<!-- gh-comment-id:917641093 --> @hibiken commented on GitHub (Sep 12, 2021): @lufishggg thank you for opening an issue! Currently, `asynq` stores the error message from the last failure (if any) and this is shown in the WebUI. If you need more error info (e.g. entire error history not just the last one, stack trace, etc) and for monitoring/alerting you can probably use an error reporting service (e.g. Bugsnag, Rollbar, Sentry, Airbrake, etc). Asynq provides [`ErrorHandler`](https://pkg.go.dev/github.com/hibiken/asynq#Config.ErrorHandler) via config so you can report all errors to a error reporting service using this hook: ```go func reportError(ctx context, task *asynq.Task, err error) { // notify error to the error reporting service } srv := asynq.NewServer(redisConnOpt, asynq.Config{ ErrorHandler: asynq.ErrorHandlerFunc(reportError), }) ```
Author
Owner

@lufishggg commented on GitHub (Sep 14, 2021):

thanks

<!-- gh-comment-id:918772337 --> @lufishggg commented on GitHub (Sep 14, 2021): thanks
Author
Owner

@hibiken commented on GitHub (Sep 21, 2021):

Closing this, but feel free to reopen if you have further questions or feedback!

<!-- gh-comment-id:923483179 --> @hibiken commented on GitHub (Sep 21, 2021): Closing this, but feel free to reopen if you have further questions or feedback!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynqmon#733
No description provided.