-
Notifications
You must be signed in to change notification settings - Fork 34
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
[JENKINS-68608] Add entire disk space usage as JENKINS_FS #71
Conversation
@hareldev thanks for the contribution. I would like to be sure to understand exactly what issue you are trying to fix. From my understanding, you would like to address issues like JENKINS-68608 where the size of the folder of a multibranch Pipeline is wrongly reported. However, looking at the PR, I'm under the impression you are not fixing the issue, but rather adding an entirely new endpoint to report the size of the whole FS containing JENKINS. What I don't exactly get is why you need such endpoint in the first place. Your monitoring system should provide you with all the necessary probes to get this information directly from your VM/container without using Jenkins. Am I missing something? |
Thanks @PierreBtz for your comment. The issue as we experience it, is not only bound to multibranch pipelines, but affects all of our jobs folders, which makes us look for additional ways to estimate the entire folder size.
while the plugin reports of 570MB / 25MB respectively:
Since we don't have any reliable source of estimating the disk space, and in order to avoid high resource usage traversing folders, it is simpler to add the entire FS endpoint to monitor. I couldn't find any other Jenkins plugin that exposes this entry to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hareldev sorry for the delay here :/
Everything looks good. If I was to nitpick, I think we should have two different UsageComputation
classes to make things clearer instead of mixing everything in one, but I don't want to bother you with that, it's not blocking, I'll do the refactoring later myself.
I'd like to run one more test on my end but if it's green expect a merge + release within the week. Again, sorry for the delay and thanks for the contribution.
@hareldev this is available in https://github.com/jenkinsci/cloudbees-disk-usage-simple-plugin/releases/tag/176.v4fdfcc443b_cf, thanks for the contribution. |
@PierreBtz Thanks for the merge! |
A common deployment of Jenkins is within a container, where JENKINS_HOME is mounted to a persistent volume.
Following various cases where I've seen differences between this plugin reported
JENKINS_HOME
usage and the actual one (calculated usingdu
), including JENKINS-68608 I'm creating this PR.The idea was to add simple, quick way of calculating the entire filesystem disk usage. Filesystem disk usage is acquired using
Jenkins.get().getRootDir().getUsableSpace()
which does not actually traverse the disk, and takes <1ms to run.This PR does not change existing entries / calculation method, but add a new entry -
JENKINS_FS
.so with the current version of this plugin,
/prometheus
endpoint will show:After this PR it will show:
Example of an actual Jenkins instance running in a container with
JENKINS_HOME
set in a volume/var/lib/jenkins
:cloudbees-disk-usage-simple-plugin
version0.10
shows 0.7GB is used (which is wrong):du
shows 7GB is used:df
shows 7.1GB is used by the filesystem:Installing the plugin with this PR implemented, adds
JENKINS_FS
with the correct values:Which could be used instead of JENKINS_HOME is such situation where it's the only folder on the mount.
Tested on various Jenkins versions, runs either on a container, or Windows server.