From 0995fa141062f2aef1ee017ca03c7f9522dc3da8 Mon Sep 17 00:00:00 2001 From: Tim Buchwaldt Date: Sat, 12 Nov 2022 12:42:53 +0100 Subject: [PATCH] Track oban failures --- lib/pleroma/web/telemetry.ex | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/telemetry.ex b/lib/pleroma/web/telemetry.ex index 505ee382c..d9c54c28f 100644 --- a/lib/pleroma/web/telemetry.ex +++ b/lib/pleroma/web/telemetry.ex @@ -72,7 +72,7 @@ def metrics do summary("vm.total_run_queue_lengths.cpu"), summary("vm.total_run_queue_lengths.io"), distribution( - "oban.job.stop", + "oban_job_completion", event_name: [:oban, :job, :stop], measurement: :duration, tags: [:worker], @@ -81,6 +81,17 @@ def metrics do reporter_options: [ buckets: [0.01, 0.025, 0.05, 0.1, 0.2, 0.5, 1, 2.5, 5, 10] ] + ), + distribution( + "oban_job_exception", + event_name: [:oban, :job, :exception], + measurement: :duration, + tags: [:worker], + tag_values: fn tags -> Map.put(tags, :worker, tags.job.worker) end, + unit: {:native, :second}, + reporter_options: [ + buckets: [0.01, 0.025, 0.05, 0.1, 0.2, 0.5, 1, 2.5, 5, 10] + ] ) ] end