Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows you to subscribe to the telemetry events and collect metrics about your jobs. We used something like the following to collect and display using telemetry metrics: ``` defmodule MyApp.Application do def start(_type, _args) do children = [ # ..... {:telemetry_poller, measurements: periodic_measurements(), period: 10_000}, {Telemetry.Metrics.ConsoleReporter, metrics: metrics()} ] opts = [strategy: :one_for_one, name: MyApp.Supervisor] Supervisor.start_link(children, opts) end defp metrics do [ counter("exq.job.started.count"), counter("exq.job.started.retry_count"), counter("exq.job.processed.retry_count"), distribution("exq.job.processed.duration", buckets: [0.1, 0.2, 0.3, 0.5, 0.75, 1, 2, 3, 5, 10] ), counter("exq.job.failed.retry_count"), distribution("exq.job.failed.duration", buckets: [0.1, 0.2, 0.3, 0.5, 0.75, 1, 2, 3, 5, 10] ) ] end end ``` Co-authored-by: Gregory Daynes <[email protected]>
- Loading branch information