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

medplum / medplum / 30569767210
92%

Build:
DEFAULT BRANCH: main
Ran 30 Jul 2026 06:23PM UTC
Jobs 1
Files 852
Run time 3min
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%
30569767210

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 %.

27 of 32 new or added lines in 9 files covered. (84.38%)

40333 of 42717 relevant lines covered (94.42%)

12259.52 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
92.11
0.0% packages/server/src/workers/data-warehouse-sync.ts
1
92.31
0.0% packages/server/src/workers/dispatch.ts
1
88.16
0.0% packages/server/src/workers/download.ts
1
87.93
0.0% packages/server/src/workers/lambda-cleaner.ts
1
83.48
0.0% packages/server/src/workers/subscription.ts
Jobs
ID Job ID Ran Files Coverage
1 30569767210.1 30 Jul 2026 06:23PM UTC 852
92.03
GitHub Action Run
Source Files on build 30569767210
  • 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 Repo
  • Github Actions Build #30569767210
  • 09e9f5d0 on github
  • Prev Build on gh-readonly-queue/main/pr-9621-3d34cb0b17063ec751efe2ad758130eb54abcd63 (#30566672722)
  • Next Build on main (#30577458137)
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