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

nbari / pg_exporter / 32159669898
89%
main: 89%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: main
Ran 18 Aug 2026 04:24PM UTC
Jobs 1
Files 124
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

18 Aug 2026 04:18PM UTC coverage: 89.702% (+0.03%) from 89.669%
32159669898

push

github

nbari
make graceful collector skips clear their metrics

A collector could finish a scrape successfully without publishing anything — an
unsupported server version, a missing view, a revoked privilege, an absent certificate
file — and its previous values stayed in the registry, served as though current. Only the
temp collector cleared them, and its history shows why a convention was not enough: temp
was copied from slru, inherited slru's missing reset, was fixed alone, and the fix never
propagated back.

## The trait

    fn collect_once(..) -> Result<Collected>   // implementation hook
    fn reset_metrics(&self)                    // required, no default
    fn collect(..) -> Result<()>               // provided: settles a Skipped

collect() keeps its name and Result<()> signature, so the registry, all 16 umbrellas and
all 283 integration-test call sites are untouched and every one of them now settles
automatically. Had settlement been a new method used only in production, the tests would
have exercised the unsettled path and could have passed while production behaved
differently. This is source-incompatible for anyone implementing Collector outside the
tree.

Skipped means "published nothing at all". A collector that refreshes part of its surface
and skips the rest must report Fresh, or the wrapper clears what it just published. An
error never clears, so a transient fault preserves registry state rather than destroying
it — which is why "I could not read my source" must not be reported as a skip.

## Scalars

A scalar metric cannot be removed while registered, so clearing one could only mean
zeroing, and a zeroed pg_ssl_certificate_valid ("invalid") or pg_ssl_enabled ("TLS off")
is a false alarm rather than an absence. Skip-capable scalars are therefore declared as
zero-label metric vectors: byte-identical on the wire, since prometheus emits no braces
for an empty label set, but removable via reset(). Pinned by a unit test.

## Bugs fixed along the way

... (continued)

1035 of 1490 new or added lines in 70 files covered. (69.46%)

348 existing lines in 28 files now uncovered.

18972 of 21150 relevant lines covered (89.7%)

426.68 hits per line

Uncovered Changes

Lines Coverage ∆ File
30
63.41
0.0% src/collectors/default/checkpointer/control.rs
28
91.44
0.0% src/collectors/database/stats.rs
24
86.72
0.0% tests/collectors/default/archiver.rs
23
75.79
0.0% src/collectors/default/checkpointer/stat.rs
21
92.61
0.0% tests/collectors/default/checkpointer.rs
20
87.94
0.0% tests/collectors/replication/replica_topology.rs
18
89.47
0.0% src/collectors/mod.rs
18
54.95
0.0% src/collectors/tls/connection_stats.rs
16
81.61
0.0% src/collectors/tls/certificate.rs
10
82.26
0.0% tests/collectors/tls/certificate.rs
9
80.43
0.0% src/collectors/tls/server_config.rs
9
95.4
0.0% tests/collectors/default/wal.rs
8
77.14
0.0% src/collectors/default/checkpointer/mod.rs
8
96.86
0.0% tests/dashboard.rs
7
88.76
0.0% src/collectors/default/archiver.rs
7
94.35
0.0% src/collectors/locks/count.rs
6
84.68
0.0% src/collectors/replication/stat_replication.rs
5
87.5
0.0% src/collectors/activity/mod.rs
5
86.84
0.0% src/collectors/database/mod.rs
5
88.37
0.0% src/collectors/default/mod.rs
5
90.8
0.0% src/collectors/default/wal.rs
5
89.66
0.0% src/collectors/exporter/mod.rs
5
89.47
0.0% src/collectors/exporter/scraper.rs
5
86.84
0.0% src/collectors/index/mod.rs
5
86.11
0.0% src/collectors/locks/mod.rs
5
87.5
0.0% src/collectors/replication/mod.rs
5
81.82
0.0% src/collectors/sequences/mod.rs
5
78.38
0.0% src/collectors/slru/mod.rs
5
85.71
0.0% src/collectors/stat/mod.rs
5
78.38
0.0% src/collectors/stat_io/mod.rs
5
89.36
0.0% src/collectors/statements/mod.rs
5
82.22
0.0% src/collectors/system/mod.rs
5
90.71
0.0% src/collectors/system/process.rs
5
78.38
0.0% src/collectors/temp/mod.rs
5
78.26
0.0% src/collectors/tls/mod.rs
5
87.8
0.0% src/collectors/vacuum/mod.rs
5
88.37
0.0% src/collectors/vacuum/stats.rs
5
90.88
0.28% tests/collectors/statements/pg_statements.rs
4
90.67
4.0% src/collectors/activity/wait.rs
4
87.88
0.0% src/collectors/database/catalog.rs
4
82.43
0.0% src/collectors/default/version.rs
4
68.18
0.0% src/collectors/replication/slots.rs
4
71.02
0.0% src/collectors/replication/stat_replication_slots.rs
4
93.49
0.0% src/collectors/slru/pg_stat_slru.rs
4
95.63
0.0% src/collectors/stat_io/pg_stat_io.rs
4
96.76
0.0% src/collectors/statements/pg_statements.rs
4
70.86
0.0% src/collectors/vacuum/analyze_progress.rs
4
93.71
0.0% src/collectors/vacuum/blockers.rs
4
69.23
0.0% src/collectors/vacuum/create_index_progress.rs
3
95.21
0.0% src/collectors/activity/connections.rs
3
70.65
0.0% src/collectors/activity/queries.rs
3
90.04
0.0% src/collectors/index/stats.rs
3
85.98
0.0% src/collectors/index/unused.rs
3
94.0
0.0% src/collectors/register_macro.rs
3
84.11
0.0% src/collectors/sequences/pg_sequences.rs
3
95.57
0.0% src/collectors/stat/user_tables.rs
3
94.22
0.0% src/collectors/system/cpu.rs
3
91.37
0.0% src/collectors/util.rs
3
89.45
0.0% src/collectors/vacuum/progress.rs
2
90.38
0.0% src/collectors/default/bgwriter.rs
2
83.87
0.0% src/collectors/default/postmaster.rs
2
85.71
0.0% src/collectors/default/settings.rs
2
90.64
0.0% src/collectors/exporter/process.rs
2
83.84
0.0% src/collectors/replication/replica.rs
2
89.69
0.0% src/collectors/system/memory.rs
2
93.19
0.0% src/collectors/temp/pg_ls_tmpdir.rs

Coverage Regressions

Lines Coverage ∆ File
76
66.5
0.0% tests/common/mod.rs
41
87.94
0.0% tests/collectors/replication/replica_topology.rs
26
90.88
0.28% tests/collectors/statements/pg_statements.rs
24
91.37
0.0% src/collectors/util.rs
23
86.72
0.0% tests/collectors/default/archiver.rs
21
96.76
0.0% src/collectors/statements/pg_statements.rs
13
54.95
0.0% src/collectors/tls/connection_stats.rs
12
89.47
0.0% src/collectors/exporter/scraper.rs
11
93.19
0.0% src/collectors/temp/pg_ls_tmpdir.rs
11
92.61
0.0% tests/collectors/default/checkpointer.rs
10
89.45
0.0% src/collectors/vacuum/progress.rs
9
81.61
0.0% src/collectors/tls/certificate.rs
9
70.86
0.0% src/collectors/vacuum/analyze_progress.rs
9
69.23
0.0% src/collectors/vacuum/create_index_progress.rs
8
90.64
0.0% src/collectors/exporter/process.rs
7
84.68
0.0% src/collectors/replication/stat_replication.rs
6
94.0
0.0% src/collectors/register_macro.rs
5
83.84
0.0% src/collectors/replication/replica.rs
5
68.18
0.0% src/collectors/replication/slots.rs
4
93.49
0.0% src/collectors/slru/pg_stat_slru.rs
3
88.76
0.0% src/collectors/default/archiver.rs
3
90.8
0.0% src/collectors/default/wal.rs
3
96.47
-0.38% tests/collectors/stat/user_tables.rs
2
91.44
0.0% src/collectors/database/stats.rs
2
89.66
0.0% src/collectors/exporter/mod.rs
2
95.63
0.0% src/collectors/stat_io/pg_stat_io.rs
2
98.45
0.0% tests/collectors/sequences.rs
1
82.26
0.0% tests/collectors/tls/certificate.rs
Jobs
ID Job ID Ran Files Coverage
1 32159669898.1 18 Aug 2026 04:24PM UTC 124
89.7
GitHub Action Run
Source Files on build 32159669898
  • Tree
  • List 124
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32159669898
  • dd1330c1 on github
  • Prev Build on sandbox (#32158387789)
  • Next Build on sandbox (#32277201221)
  • 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