Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new metric for Quiet Mode status #686

Closed
sstafford opened this issue Jul 26, 2024 · 2 comments
Closed

Add new metric for Quiet Mode status #686

sstafford opened this issue Jul 26, 2024 · 2 comments

Comments

@sstafford
Copy link

What feature do you want to see added?

I would like to monitor the QuietDown status of the Jenkins server. This will allow me to alert on cases where Jenkins is unintentionally left in quiet mode after automated maintenance is completed.

The Jenkins.isQuietingDown method can be used to determine the status:

Upstream changes

No response

Are you interested in contributing this feature?

Yes, I will submit a pull request.

sstafford added a commit to sstafford/prometheus-plugin that referenced this issue Jul 26, 2024
This metric exposes the Jenkins isQuietingDown status as a gauge.
When Jenkins is in quiet mode, the new metric will represent this
as a '1', otherwise the value will be '0'

Exposing this metric allows Prometheus to determine whether Jenkins
is in quiet mode.  This can be useful in cases where an alert should
be triggered if quiet mode has been enabled for too long or falls
outside of a maintenance window.

Fixes issue jenkinsci#686
@sstafford
Copy link
Author

I have submitted a pull request to address this issue. There is a unit test for the code, and I also built the hpi file and deployed it to a Jenkins instance to confirm that the metric was available in the /prometheus endpoint and that the value changed when I enabled and disabled quiet mode in the Jenkins UI.

Waschndolos pushed a commit that referenced this issue Jul 27, 2024
* New metric indicating whether Jenkins is in quietdown mode

This metric exposes the Jenkins isQuietingDown status as a gauge.
When Jenkins is in quiet mode, the new metric will represent this
as a '1', otherwise the value will be '0'

Exposing this metric allows Prometheus to determine whether Jenkins
is in quiet mode.  This can be useful in cases where an alert should
be triggered if quiet mode has been enabled for too long or falls
outside of a maintenance window.

Fixes issue #686

* Fixing JenkinsStatusCollectorTest unit test

The unit test checks the number of status metrics.
Adding a new metric caused this test to fail.
The number of metrics needed to be incremented to fix the test.
@Waschndolos
Copy link

merged with #687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants