Closed MrDecisive closed 3 years ago
We ran into the same issue. Our Telegraf agent now doesn't collect any metrics from Jenkins. Anyone knows if there's a workaround for this?
Another :+1: for this issue... We use one-shot workers, so these metrics are of no use to us...
Would be great if had the option to disable them...
Had a quick look on it but no time. Guess the fix is somewhere in org.jenkinsci.plugins.prometheus.service.DefaultPrometheusMetrics#collectMetrics
. The DropwizardExports returns multiple metrics like jenkins.node.org.jenkinsci.plugins.prometheus.util.MetricsFormatter#formatMetrics
renames them then we get multiple "jenkins_node_builds" with {node=xxx} but the #HELP and #TYPE stay in the list.
Is somebody working on this? I just tried to point to the issue but I have no knowledge how this should work. Would be nice to have a solution soon because our Jenkins monitoring is broken since then.
still no fix or workaround for this issue :( keeeping us blinde to issue in our jenkins
Please use latest version
Correct me if I'm wrong but prometheus:2.0.10 is the latest version right? Which is the version we're all using.
Hi,
We are seeing the following error reported in Telegraf when trying to read the output of the jenkinsci/prometheus-plugin.
telegraf[7915]: 2021-04-20T13:52:30Z E! [inputs.prometheus] Error in plugin: error reading metrics for http://\<host>/prometheus/: reading text format failed: text format parsing error in line 1394: second TYPE line for metric name "jenkins_node_builds", or TYPE reported after samples
Yesterday it seemed this error occured on the jenkins instance which had the recently released version prometheus:2.0.10 installed but I subsequently upgraded another (test) instance to the same version prometheus:2.0.10 and the problem was not reported...
I checked the outputs of the prometheus plugin at \<jenkins-url>/\<prometheus-metric-endpoint> and I found on the working version it was not outputting a "jenkins_node_builds" metric section at all. On the version that is failing it outputs multiple "jenkins_node_builds" sections but the first section is missing the #HELP and #TYPE lines. This fits with Telegraf's report as it first sees a metric section with no #HELP or #TYPE for "jenkins_node_builds" and then later on finds the #HELP and # TYPE lines for the next section so in it's eyes the header lines are coming after the section they should be attached to?? (I'm only guessing here)
I've included the Version report for both the working version and the broken version as I don't know where the "jenkins_node_builds" section is originating from and it could be the plugin outputting that metric might be the problem
Anyway hope this helps Cheers Phill
Version report
Broken Version
Working Version
Reproduction steps
Step 1 - Go to \<jenkins-url>/\<prometheus-metric-endpoint> Step 2 - Search for 'jenkins_node_builds' metric
Results
Expected result:
Actual result: