kured icon indicating copy to clipboard operation
kured copied to clipboard

If a sentinel command is configured, it runs every minute.

Open haraldkoch opened this issue 2 years ago • 9 comments

The configured sentinel command runs every minute, instead of once every period. The reason for this is appears to be the Prometheus metrics updater maintainRebootRequiredMetric() here:

https://github.com/kubereboot/kured/blob/9e4b69f8189cbf685e459ad1be2eb15f4dfd0cd2/cmd/kured/main.go#L566C1-L575C2

This is arguably incorrect. The metric should be updated only when the sentinel command is run in the main code (i.e. once every period interval).

A compromise would be to have the function maintainRebootRequiredMetric() sleep for period instead of the hard-coded time.Minute that is there now.

haraldkoch avatar Nov 22 '23 03:11 haraldkoch

This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days).

github-actions[bot] avatar Jan 22 '24 01:01 github-actions[bot]

The configured sentinel command runs every minute, instead of once every period.

I can confirm this behaviour for version 1.15.0. Although I set period to 30min the sentinel command runs every 1min.

miheinr avatar Jan 30 '24 09:01 miheinr

This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days).

github-actions[bot] avatar Mar 31 '24 01:03 github-actions[bot]

Since no one has turned up to defend the code's position, I have to infer that we'd be open to some kind of PR to fix this.

(Un-labeled as inactive)

kingdonb avatar Apr 01 '24 13:04 kingdonb

@haraldkoch @kingdonb is this as simple as this? https://github.com/kubereboot/kured/pull/919

Note the potential downside for folks who want to have a separate periodicity for metrics data.

jackfrancis avatar Apr 02 '24 22:04 jackfrancis

Huzzah!

Note the potential downside for folks who want to have a separate periodicity for metrics data.

The Prometheus library caches the metric values passed to metric.Set(), and returns the cached value to anyone who queries the metrics endpoint, so this shouldn't affect any metrics data.

haraldkoch avatar Apr 02 '24 22:04 haraldkoch

This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days).

github-actions[bot] avatar Jun 02 '24 01:06 github-actions[bot]

It would be lovely to merge the linked PR instead of letting this issue decay again?

haraldkoch avatar Jun 06 '24 17:06 haraldkoch

This issue was automatically considered stale due to lack of activity. Please update it and/or join our slack channels to promote it, before it automatically closes (in 7 days).

github-actions[bot] avatar Aug 06 '24 01:08 github-actions[bot]