Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66790

DiskUsageCollector is enabled even when the "Collect disk usage" checkbox is unchecked

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • prometheus-plugin
    • 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

      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
      

            jequals5 Marky Jackson
            agabrys Adam Gabryś
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: