+ 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]
+ ]
+ ),
+ distribution(
+ "tesla_request_completed",
+ event_name: [:tesla, :request, :stop],
+ measurement: :duration,
+ tags: [:response_code],
+ tag_values: fn tags -> Map.put(tags, :response_code, tags.env.status) end,
+ unit: {:native, :second},
+ reporter_options: [
+ buckets: [0.01, 0.025, 0.05, 0.1, 0.2, 0.5, 1, 2.5, 5, 10]
+ ]
+ ),
+ distribution(
+ "oban_job_completion",
+ event_name: [:oban, :job, :stop],
+ 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
+
+ defp summary_metrics do
+ [
+ # Phoenix Metrics
+ summary("phoenix.endpoint.stop.duration",
+ unit: {:native, :millisecond}
+ ),
+ summary("phoenix.router_dispatch.stop.duration",
+ tags: [:route],
+ unit: {:native, :millisecond}
+ ),