-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Prometheus metrics plugin: 2.0.10
-
-
2.0.11
Jenkins logs are full of:
Oct 04, 2021 11:16:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:18:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:20:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:22:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:24:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:26:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:28:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:30:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:32:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:34:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:36:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable Oct 04, 2021 11:38:54 AM WARNING org.jenkinsci.plugins.prometheus.DiskUsageCollector collect Cannot get disk usage data. Install CloudBees Disk Usage Simple plugin to enable
Even when the "Collect disk usage" button is unchecked:
I've analyzed the code and it seams that the "Collect disk usage" configuration option is ignored, see marked lines in
- org.jenkinsci.plugins.prometheus.DiskUsageCollector (27)
- org.jenkinsci.plugins.prometheus.util.ConfigurationUtils (24)
- org.jenkinsci.plugins.prometheus.config.PrometheusConfiguration (148)
The collector is always enabled (true is returned). The ConfigurationUtils class should execute getCollectDiskUsage instead of getDefaultCollectDiskUsage.
We use Configuration As A Code to configure the plugin:
data: configuration-as-code.yaml: | unclassified: prometheusConfiguration: appendParamLabel: false appendStatusLabel: false collectDiskUsage: false collectingMetricsPeriodInSeconds: 120 countAbortedBuilds: true countFailedBuilds: true countNotBuiltBuilds: true countSuccessfulBuilds: true countUnstableBuilds: true defaultNamespace: "default" fetchTestResults: true jobAttributeName: "jenkins_job" path: "prometheus-metrics" processingDisabledBuilds: false useAuthenticatedEndpoint: false
- links to