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

nbari / pg_exporter / 34208940068
90%
main: 90%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: main
Ran 08 Sep 2026 09:19AM UTC
Jobs 1
Files 125
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

08 Sep 2026 09:14AM UTC coverage: 89.789% (+0.01%) from 89.777%
34208940068

push

github

nbari
fix: record aborted scrapes as aborted and coalesce overlapping OS samples

Follow-ups from reviewing 006acaa.

Aborted scrapes masqueraded as successes in the exporter's self-metrics.
When a scrape is aborted mid-flight (timeout or client disconnect, #34),
every in-flight collector's ScrapeTimer was dropped without an outcome, and
Drop recorded that as a success with a timeout-sized duration: during exactly
the incident those metrics exist for, last_scrape_success read 1 and
pg_exporter_collector_scrape_duration_seconds gained a bogus +Inf sample.
An unobserved drop now increments the new
pg_exporter_collector_scrape_aborted_total{collector} counter and sets
last_scrape_success to 0. The duration is still observed, now documented as
time-until-abort, so a stalled collector still shows up in _sum / _count.

A slow or hung OS read could pile tasks onto the blocking pool. A started
spawn_blocking task cannot be cancelled, so once the gate began reopening on
timeout (#34), a sample that outlives its scrape - an over-timeout PSS walk,
or ssl_cert_file on a hung mount - accumulated one queued blocking-pool task
per scrape, unbounded. Sampling is now coalesced: the process-group collector
takes its baseline lock with try_lock and a scrape that finds a sample
already running skips its own (the in-flight one publishes newer data
anyway), and the TLS certificate read holds a one-slot lock so a hung read
leaks exactly one blocking thread instead of one per scrape. A side effect
worth having: with a walk slower than the scrape timeout, scrapes that
overlap an in-flight walk now succeed serving the last published
process-group gauges instead of every scrape timing out.

Measured with a 2GB shared_buffers container under pgbench load (PSS walk
~1.2-2.5s) and --scrape.timeout-ms 500, 50 scrapes: before, 50/50 returned
504 while the process thread count climbed 34 -> 69 (~1/s, unbounded) and 17
aborts were recorded as phantom successes; after, 45/50 returned 200, th... (continued)

272 of 296 new or added lines in 6 files covered. (91.89%)

6 existing lines in 2 files now uncovered.

19705 of 21946 relevant lines covered (89.79%)

479.69 hits per line

Uncovered Changes

Lines Coverage ∆ File
16
77.56
-2.06% tests/collector_safety.rs
5
92.28
1.23% src/collectors/exporter/scraper.rs
1
94.08
1.13% src/collectors/system/process.rs
1
81.87
-0.15% src/collectors/tls/certificate.rs
1
90.82
0.23% tests/connection_budget.rs

Coverage Regressions

Lines Coverage ∆ File
3
95.21
-0.76% src/collectors/activity/connections.rs
3
86.67
-4.0% src/collectors/activity/wait.rs
Jobs
ID Job ID Ran Files Coverage
1 34208940068.1 08 Sep 2026 09:19AM UTC 125
89.79
GitHub Action Run
Source Files on build 34208940068
  • Tree
  • List 125
  • Changed 11
  • Source Changed 8
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34208940068
  • 00f64abe on github
  • Prev Build on sandbox (#34194148324)
  • Next Build on sandbox (#34222617160)
  • Delete
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