Skip to content
BleemeoBleemeo

Jenkins

Auto-Detection
Built-in Metrics

Bleemeo monitors Jenkins through automatic service detection and metrics collection for executors and build jobs.

Glouton automatically detects Jenkins instances running on the system.

To enable metrics gathering, you must configure the Jenkins URL and API credentials.

If auto-detected parameters are incorrect, you can override them manually.

Terminal window
sudo tee /etc/glouton/conf.d/99-jenkins.conf > /dev/null << 'EOF'
service:
# For a Jenkins running outside a container
- type: "jenkins"
address: "127.0.0.1"
port: 8080
# To enable metric gathering, stats_url, username, and password are required.
stats_url: "http://jenkins.example.com"
username: my_user
password: my_api_token
## TLS configurations (optional)
ca_file: "/myca.pem"
cert_file: "/mycert.pem"
key_file: "/mykey.pem"
ssl_insecure: false
# Choose jobs to include or exclude. Exclude has priority over include.
# Wildcards are supported: ["jobA/*", "jobB/subjob1/*"]. If empty, all jobs are included.
included_items: []
excluded_items: []
# For a Jenkins running in a Docker container
- type: "jenkins"
instance: "CONTAINER_NAME"
port: 8080
stats_url: "http://jenkins.example.com"
username: my_user
password: my_api_token
EOF

Glouton automatically detects configuration changes.

When using Docker, you can use labels to set the configuration:

Terminal window
docker run --label glouton.stats_url="http://jenkins.example.com" --label glouton.username="my_user" [...]
MetricDescription
service_statusStatus of Jenkins
jenkins_busy_executorsNumber of busy executors
jenkins_total_executorsTotal number of executors (both busy and idle)
jenkins_job_duration_secondsJob duration in seconds
jenkins_job_numberNumber of times this job has been run
jenkins_job_result_codeJob result code (0 = SUCCESS, 1 = FAILURE, 2 = NOT_BUILD, 3 = UNSTABLE, 4 = ABORTED)

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

The check only opens the TCP port — it sends no command — so it fails when the port is wrong (Connection refused), when a firewall drops the packets (connection timed out after 10 seconds), or when the configured address cannot be parsed (Invalid TCP address). A green check proves the port is open, and nothing more.

Glouton creates the Jenkins collector only when both stats_url and password are set — the password being an API token, not the account password. Without either, the service reports only service_status.

Reproduce what Glouton does, from the machine where the agent runs:

Terminal window
curl -i -u USERNAME:API_TOKEN http://127.0.0.1:8080/api/json
What you see Cause Fix
nothing — the collector is never created stats_url or password missing Set stats_url, username and password
401 Invalid or revoked API token Generate a new token from the user’s Configure page
403 The user lacks the Overall/Read permission Grant read access to that user
a TLS error Jenkins runs behind HTTPS with a private certificate Use a URL the agent can verify, or expose plain HTTP on 127.0.0.1
404 Jenkins is served under a prefix Include the prefix in stats_url, for example http://127.0.0.1:8080/jenkins