liske / needrestart

Restart daemons after library updates.
GNU General Public License v2.0
426 stars 67 forks source link

Implement option to output information as OpenMetrics time series #308

Closed lelutin closed 2 months ago

lelutin commented 2 months ago

This new -o option will make needrestart output information in a format that can be scraped by Prometheus or any other daemon that ingests OpenMetrics format.

The -l, -w and -k options can be used in combination with -o in order to choose what information gets exported.

(Closes: #291)

lelutin commented 2 months ago

note, I've chosen to split the version information out into a dedicated ...build_info time series. This makes it possible to graph the timestamp normally without risking discontinuity if needrestart and/or perl is upgraded and thus the labels change, and the dedicated metric can be used just for aggregation if needs be.

lelutin commented 2 months ago

I've reworked this branch to incorporate feedback from @anarcat and other details found while reading the OpenMetrics spec more in depth and I've just force-pushed the result.

what's to be expected as being changed in this force-push;

liske commented 2 months ago

Thanks!

anarcat commented 2 months ago

awesome, thanks for the fixes