Skip to content

Fix Oban.PerformError grouping #92

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

Merged
merged 3 commits into from
Sep 11, 2024
Merged

Fix Oban.PerformError grouping #92

merged 3 commits into from
Sep 11, 2024

Conversation

odarriba
Copy link
Contributor

This change improves how we store data from Oban.PerformError errors.

Those errors don't come from exceptions, as they are delivered via Telemetry when the worker ends up with an :error or an {:error, any()} tuple.

As they are not exceptions, there is no stack trace, and they were been detected as the same error by our fingerprinting algo.

This changes introduces an fix that adds the worker module as the only stacktrace of the occurrence, so the error can populate the source_function attribute and different workers generate different error groupings.

We cannot generate different error groups per different outputs of a worker. In that case, you should use raise, that generates a full stack trace and works as expected.

Closes #87

@odarriba odarriba changed the title WIP: Fix Oban.PerformError grouping Fix Oban.PerformError grouping Sep 10, 2024
@odarriba odarriba self-assigned this Sep 10, 2024
@odarriba odarriba added the bug Something isn't working label Sep 10, 2024
@odarriba odarriba requested a review from crbelaus September 10, 2024 15:31
Copy link
Contributor

@crbelaus crbelaus left a comment

Choose a reason for hiding this comment

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

Works like a charm 🚀

Comment on lines +78 to +81
stacktrace =
if stacktrace == [],
do: [{String.to_existing_atom("Elixir." <> job.worker), :perform, 2, []}],
else: stacktrace
Copy link
Contributor

Choose a reason for hiding this comment

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

🥇

@crbelaus crbelaus merged commit c0c94fa into main Sep 11, 2024
3 checks passed
@crbelaus crbelaus deleted the fix-oban-grouping branch September 11, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong grouping of occurrences?
2 participants