Menu

Monitoring Jenkins with Prometheus: queue, executors, build duration, and five PromQL alerts
📰

Monitoring Jenkins with Prometheus: queue, executors, build duration, and five PromQL alerts

DEV Community: jenkins·DevKit·3 days ago
#zhwAbMXy
#devtojenkins#devto#dev#jenkins#alert
Reading 0:00
15s threshold

Jenkins problems usually surface as complaints: "my build is stuck", "no agents available", "everything was green yesterday". The Jenkins UI shows the current state, but not how the queue grew or when the free executors ran out. This post covers the metrics that answer those questions and five alert rules in PromQL.

The examples use a free Grafana dashboard, Jenkins Lite: https://grafana.com/grafana/dashboards/26040/ . Every metric name below comes from the dashboard JSON.

Expose the metrics

Install the Prometheus metrics plugin in Jenkins. It serves metrics at /prometheus , with the default prefix default_jenkins_ . If you changed the prefix in the plugin settings, the dashboard queries need the same change.

scrape_configs : - job_name : jenkins metrics_path : /prometheus static_configs : - targets : [ "jenkins:8080" ]

Enter fullscreen mode

Exit fullscreen mode

If your Jenkins requires authentication, add credentials to the scrape job (use placeholders in anything you share).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.