Skip to content

Commit

Permalink
Add new feature to Oban docs (Elixir) (#12631)
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide authored Feb 10, 2025
1 parent 8bf4d39 commit 8715c6a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/platforms/elixir/integrations/oban/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,27 @@ You can use this for more complex filtering logic based on number of attempts an

See <Link to="/platforms/elixir/configuration/filtering">the documentation for event callbacks</Link>.
</Alert>

### Customizing Job Check-In Information

If you want to customize the information that is sent to Sentry when a job checks in, you can do so by providing a function that takes the job and returns a map of metadata.

```elixir {filename:lib/my_app/my_worker.ex}
defmodule MyApp.MyWorker do
use Oban.Worker

@behaviour Sentry.Integrations.Oban.Cron

@impl Oban.Worker
def perform(args) do
# ...
end

@impl Sentry.Integrations.Oban.Cron
def sentry_check_in_configuration(job) do
[monitor_slug: "custom-slug-#{job.id}"]
end
end
```

This is available since v10.9.0 of the SDK.

0 comments on commit 8715c6a

Please sign in to comment.