2023-09-25 08:53:00.318+0000 [id=31] WARNING o.j.p.p.c.PrometheusConfiguration#setCollectDiskUsageBasedOnEnvironmentVariableIfDefined: Unable to parse environment variable 'COLLECT_DISK_USAGE'. Must either be 'true' or 'false'. Ignoring...
Expected behaviour
No warning occurs because COLLECT_DISK_USAGE is not set.
We e.g. configured Jenkins via CasC and therefore don't use environment variables.
Steps to reproduce
Install the plugin and start Jenkins
Actual behaviour
The following warning occurs:
Expected behaviour
No warning occurs because
COLLECT_DISK_USAGE
is not set.We e.g. configured Jenkins via CasC and therefore don't use environment variables.
The warning occurs due to https://github.com/jenkinsci/prometheus-plugin/blob/e274fc47e78ef9499b3696564df4850b32e88b2d/src/main/java/org/jenkinsci/plugins/prometheus/config/PrometheusConfiguration.java#L125-L146
I think the warning should only occur if the environment variable is set but it's invalid. This could be achieved with the following code:
Server configuration
Operating system: N/A Jenkins Version: N/A Plugin Version: 2.3.3 (currently latest)
Notify
@Waschndolos