• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tomasz-tomczyk / oban_doctor / 200a1d0df66d66af1efbce9bf48009f969212338
89%

Build:
DEFAULT BRANCH: main
Ran 26 Jan 2026 10:46AM UTC
Jobs 1
Files 19
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Jan 2026 10:45AM UTC coverage: 90.947% (+0.3%) from 90.674%
200a1d0df66d66af1efbce9bf48009f969212338

push

github

web-flow
Add `QueueMetrics` plugin for runtime queue monitoring (#3)

* Add QueueMetrics plugin for runtime queue monitoring

Implements the first runtime plugin for ObanDoctor (Phase 2 of roadmap).
The plugin provides a live DB query API to get queue metrics including:

- Job counts by state (available, scheduled, executing, etc.)
- Queue limits from Oban config
- Utilization percentage (executing / limit * 100)

Key features:
- Extracts prefix, queues, and limits from Oban config automatically
- Supports filtering to specific queues via :queues option
- Uses Ecto.Query with Oban.Job schema for type-safe queries
- SQL-level filtering for efficiency

Also adds test infrastructure:
- Test repo with Ecto sandbox
- Oban migrations in test setup
- Mix aliases for ecto.setup/reset

* Add PostgreSQL service to CI workflow

* Add plugins documentation

* Add Oban.Plugin behaviour and telemetry to QueueMetrics

- Implement Oban.Plugin behaviour following official plugin patterns
- Use defstruct, child_spec, terminate for proper GenServer lifecycle
- Emit [:oban_doctor, :queue, :metrics] telemetry on schedule
- Use Oban.Peer for leader election (only leader emits)
- Fix prefix handling: use as PostgreSQL schema, not table name prefix
- Make Oban a regular dependency (required for behaviour)
- Add tests for validation and telemetry emission

* Document telemetry events and NewRelic integration

- Clarify telemetry section in moduledoc with handler example
- Add plugin configuration guide with multiple instances
- Document telemetry event structure
- Add NRQL query examples for NewRelic
- Add custom telemetry handler example

* Add tests for improved coverage of QueueMetrics

- Test :oban option for extracting config from running instance
- Test unexpected message handling
- Test timer cancellation on terminate
- Coverage improved from 83.9% to 91.9%

* Add format_logger_output callback for Oban logger compatibility

- Add format_logger_output/2 Plugin callback to suppor... (continued)

82 of 89 new or added lines in 1 file covered. (92.13%)

432 of 475 relevant lines covered (90.95%)

14.34 hits per line

Uncovered Changes

Lines Coverage ∆ File
7
92.13
lib/oban_doctor/plugins/queue_metrics.ex
Jobs
ID Job ID Ran Files Coverage
1 200a1d0df66d66af1efbce9bf48009f969212338.1 26 Jan 2026 10:46AM UTC 19
90.95
GitHub Action Run
Source Files on build 200a1d0df66d66af1efbce9bf48009f969212338
  • Tree
  • List 19
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 200a1d0d on github
  • Prev Build on main (#8DA892BE...)
  • Next Build on main (#C49AB895...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc