question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jenkins_builds_duration_milliseconds_summary wont get displayed in prometheus

See original GitHub issue

add following environment vars:

PROMETHEUS_NAMESPACE=testing
PROMETHEUS_ENDPOINT=metrics

when i check my metrics

http://localhost:8080/metrics/

# HELP testing_jenkins_builds_duration_milliseconds_summary Summary of Jenkins build times in milliseconds by Job
# TYPE testing_jenkins_builds_duration_milliseconds_summary summary
testing_jenkins_builds_duration_milliseconds_summary_count{job="TEST1",} 1.0
testing_jenkins_builds_duration_milliseconds_summary_sum{job="TEST1",} 1.0
testing_jenkins_builds_duration_milliseconds_summary_count{job="TEST2",} 31.0
testing_jenkins_builds_duration_milliseconds_summary_sum{job="TEST2",} 31.0

But i cant see these entries in prometheus… All the other metrics are working fine and get displayed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
hawky-4s-commented, Feb 26, 2018

I experienced the same problem. My solution was to set ACL in Jenkins to allow anonymous user to read jobs as that is the user prometheus scrape client is using.

4reactions
Levitercommented, Mar 1, 2018

Now that I got it working, let me share what I did and also describe the situation we have…

We are using the Multi-branch plugin and have a private organisation on Github. So our repos are private. We can use our (personal) Github account to log into Jenkins. The prometheus plugin was not able to show the build metrics for those repos. Since we have also have a ‘generic’ user that is allowed to access Github and clone repos in order to be able to build them, I used the same user to create a token which I then use to do the authentication for the plugin for.

In the prometheus.yml (where we do the scraping of the metrics) I added a basic_authentication part where the username is the username of the ‘generic’ user. The password is the token that was generated on Github.

After this, it worked for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metrics - Jenkins Plugins
duration gives an approximate measure of the number of executors required in order to ensure that every build request results in a build....
Read more >
Jenkins Integration | Tanzu Observability Documentation
This integration uses the Prometheus plugin to get the data from Jenkins. ... jenkins.default.jenkins.builds.duration.milliseconds.summary.
Read more >
Jenkins agent monitoring with Prometheus | by Rudolf Horváth
Following this guide you can create a Jenkins job, to forward basic monitoring metrics about the connected Jenkins agents to a Prometheus ......
Read more >
The 4 Types Of Prometheus Metrics - Tom Gregory
summaries are a good option if you need to calculate accurate quantiles, but can't be sure what the range of the values will...
Read more >
Jenkins Prometheus Plugin - Google Groups
I'm trying to monitor the build time + successful vs failed build rate with prometheus. ... Summary of Jenkins build times in milliseconds...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found