mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 20:13:31 +03:00
Expand oban error tracking for plugins/notifiers (#1864)
* Plugin exceptions may be silently covering up database problems such as failed cron job inserts. * The previously tracked `:circuit` event is no longer emitted.
This commit is contained in:
parent
ce55dc4ae9
commit
a64cc84db2
@ -47,7 +47,7 @@ defmodule Plausible.Application do
|
||||
|
||||
:telemetry.attach_many(
|
||||
"oban-errors",
|
||||
[[:oban, :job, :exception], [:oban, :circuit, :trip]],
|
||||
[[:oban, :job, :exception], [:oban, :notifier, :exception], [:oban, :plugin, :exception]],
|
||||
&ErrorReporter.handle_event/4,
|
||||
%{}
|
||||
)
|
||||
|
@ -7,11 +7,19 @@ defmodule ErrorReporter do
|
||||
|
||||
on_job_exception(job)
|
||||
|
||||
Sentry.capture_exception(meta.error, stacktrace: meta.stacktrace, extra: extra)
|
||||
Sentry.capture_exception(meta.reason, stacktrace: meta.stacktrace, extra: extra)
|
||||
end
|
||||
|
||||
def handle_event([:oban, :circuit, :trip], _measure, meta, _) do
|
||||
Sentry.capture_exception(meta.error, stacktrace: meta.stacktrace, extra: meta)
|
||||
def handle_event([:oban, :notifier, :exception], _timing, meta, _) do
|
||||
extra = Map.take(meta, ~w(channel payload)a)
|
||||
|
||||
Sentry.capture_exception(meta.reason, stacktrace: meta.stacktrace, extra: extra)
|
||||
end
|
||||
|
||||
def handle_event([:oban, :plugin, :exception], _timing, meta, _) do
|
||||
extra = Map.take(meta, ~w(plugin)a)
|
||||
|
||||
Sentry.capture_exception(meta.reason, stacktrace: meta.stacktrace, extra: extra)
|
||||
end
|
||||
|
||||
defp on_job_exception(%Oban.Job{
|
||||
|
Loading…
Reference in New Issue
Block a user