Package: prometheus-node-exporter-collectors / 0.0~git20230203.6f710f8-1+deb12u2

Metadata

Package Version Patches format
prometheus-node-exporter-collectors 0.0~git20230203.6f710f8-1+deb12u2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 do not run apt update or simulate apt dist upgrade.patch | (download)

apt_info.py | 9 0 + 9 - 0 !
1 file changed, 9 deletions(-)

 [patch] do not run apt update or simulate apt dist-upgrade
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is causing all sorts of problems. The first of which is that
we're hitting our poor mirrors every time the script is ran, which, in
the Debian package configuration, is *every 15 minutes* (!!).

The second is that this locks the cache and makes this script
needlessly stumble upon a possible regression in APT from Debian
bookworm and Ubuntu 22.06:

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2003851

That still has to be confirmed: it's possible that `apt update` can
hang for a long time, but that shouldn't concern us if we delegate
this work out of band.

I also do not believe actually performing the `dist-upgrade`
calculations is necessary to compute the pending upgrades at all. I've
done work with python-apt for other projects and haven't found that to
be required: the cache has the necessary information about pending
upgrades.

Closes: #179

Signed-off-by: Antoine Beaupr <anarcat@debian.org>

0001 report the apt cache timestamp.patch | (download)

apt_info.py | 12 12 + 0 - 0 !
1 file changed, 12 insertions(+)

 [patch] report the apt cache timestamp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We use the `pkgcache.bin` modification time as a heuristic, but there
might be a better way to do this.

We also silently ignore errors when pulling that file to avoid broken
systems from breaking the other metrics. I believe this will lead to a
null metric which is probably what we want anyway.

A possible improvement to this would be to individually inspect the
`InRelease` files and report the mirror's timestamps as well, but
that's more involved. It's also not a priority compared to this fix,
because we want the update timestamp if we remove the `apt update`
run (in #181).

Closes: #180

Signed-off-by: Antoine Beaupr <anarcat@debian.org>
Co-authored-by: Ben Kochie <superq@gmail.com>

0001 use a better heuristic for the apt update last run t.patch | (download)

apt_info.py | 12 11 + 1 - 0 !
1 file changed, 11 insertions(+), 1 deletion(-)

 [patch] use a better heuristic for the apt update last run time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As reported in #182, `pkgcache.bin` gets updated on more than just
`apt update`. In particular, it gets modified when a package is
installed, upgraded or removed.

So let's fallback on a better heuristic, which is the `APT::Periodic`
timestamp. This should give us a much more precise and deliberate
status.

We also fallback to the `lists` directory, which gets updated when new
mirror lists gets moved into place. This does run the risk of staying
silently unchanged if there's no change on mirrors but (a) that's
rather infrequent and (b) we might actually want to warn on that
anyway.

Signed-off-by: Antoine Beaupr <anarcat@debian.org>
Closes: #183

0001 apt_info.py fix apt_upgrades_pending and apt_upgrade.patch | (download)

apt_info.py | 7 5 + 2 - 0 !
1 file changed, 5 insertions(+), 2 deletions(-)

 apt_info.py: fix apt_upgrades_pending and apt_upgrades_held

Backported from
https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/pull/207

0002 Improve heuristic for the apt update last run time 2.patch | (download)

apt_info.py | 11 7 + 4 - 0 !
1 file changed, 7 insertions(+), 4 deletions(-)

 improve heuristic for the apt update last run time (#208)

As suggested by #194 and this fixes it

Signed-off-by: kennethso168 <kennethso168@gmail.com>