Skip to content
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

Allow capture of error class when job fails #34

Merged

Conversation

niborg
Copy link
Contributor

@niborg niborg commented Mar 7, 2024

This gem captures failed jobs with the jobs_failed_total metric, but does not provide a way to add an error label for the error's class, which can be useful. This commit allows developers to optionally include a label with the error class on the jobs_failed_total metric.

This gem captures failed jobs with the jobs_failed_total metric,
but does not provide a way to add an error label for the error's
class, which can be useful. This commit allows developers to
optionally include a label with the error class on the
jobs_failed_total metric.
end.not_to \
increment_yabeda_counter(Yabeda.sidekiq.jobs_executed_total).with(
{ queue: "default", worker: "FailingPlainJob", error: "FailingPlainJob::SpecialError" } => 1,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks to make sure that the tags being used with jobs_failed_total are not being used for jobs_executed_total.

@Envek Envek merged commit 6cc2511 into yabeda-rb:master Mar 7, 2024
5 checks passed
@Envek
Copy link
Member

Envek commented Mar 7, 2024

Thanks!

@Envek
Copy link
Member

Envek commented Mar 8, 2024

Released in 0.12.0, enjoy!

@niborg niborg deleted the niborg/add-tag-for-error-class-on-exception branch March 8, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants