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

medplum / medplum / 30568333695 / 1
92%
main: 92%

Build:
Build:
LAST BUILD BRANCH: medplum-dw-otel
DEFAULT BRANCH: main
Ran 30 Jul 2026 06:12PM UTC
Files 852
Run time 23s
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

30 Jul 2026 05:57PM UTC coverage: 92.028% (+0.006%) from 92.022%
30568333695.1

push

github

web-flow
feat(server): add queue activeCount, per-queue in-flight and completed job metrics, and async batch entry throughput (#10005)

* feat(server): add queue activeCount, per-host in-flight jobs, and async batch rates

Adds three kinds of queue observability to the OpenTelemetry heartbeat:

- `medplum.<queue>.activeCount` gauge, alongside the existing waiting and
  delayed counts.
- `medplum.<queue>.inFlightJobs` UpDownCounter, maintained per-process by every
  worker via a new `trackInFlightJobs` processor wrapper. This wraps the
  processor rather than listening for the worker's active/completed/failed
  events because those do not pair up: BullMQ suppresses `failed` when a job is
  moved to delayed, and suppresses both terminal events once the connection is
  closing, either of which would leave the counter permanently incremented.
- `medplum.batch.completedPerSecond` and `medplum.batch.entriesPerSecond`,
  derived by a new `setRateGauge` helper from running totals the batch worker
  keeps. The entry rate covers the re-entrant path only; the deprecated legacy
  path hands the whole bundle to the router at once.

Per-queue metric names now go through `getQueueMetricName`, keeping the queue in
the metric name rather than an attribute to match how these have always been
reported. `QueueMetric` documents why `activeCount` and `inFlightJobs` measure
different things and are not expected to agree.

Also adds `getUpDownCounter`/`addToUpDownCounter` helpers, and documents the
UpDownCounter instrument in the otel README.

Signed-off-by: Derrick Farris <derrick@medplum.com>

* refactor(server): count async batch throughput instead of computing a rate

Replaces the `medplum.batch.completedPerSecond` and
`medplum.batch.entriesPerSecond` gauges, and the `setRateGauge` helper that
backed them, with two plain monotonic counters:

- `medplum.batch.job.completed.count`
- `medplum.batch.entry.processed.count`

Deriving the rate is now the observability backend's job, whi... (continued)

22743 of 25823 branches covered (88.07%)

Branch coverage included in aggregate %.

40333 of 42717 relevant lines covered (94.42%)

12259.52 hits per line

Source Files on job 30568333695.1
  • Tree
  • List 852
  • Changed 11
  • Source Changed 10
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30568333695
  • 09e9f5d0 on github
  • Prev Job for on gh-readonly-queue/main/pr-10005-86d1f963c368a87cde51062b253331e8cb9d9828 (#30566672722.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc