Monitor Jenkins performance
DevOps teams should continuously monitor Jenkins performance to ensure it runs effectively. With this, the team can:
- Analyze the trends of the successful builds and failed builds in the queue on a regular basis.
- Carry out health checks to avoid Jenkins server latency spikes.
- Monitor the number of projects associated.
- Track the list of plugins used.
- Receive instant alerts when an entity is broken.
Ensure continuous delivery by monitoring Jenkins pipeline performance
Read how you can leverage Site24x7 to detect failed builds, identify performance issues, optimize resource allocation and capacity planning, and improve pipeline efficiency of your Jenkins instances.
Get started with Site24x7's Jenkins monitoring tool
Jenkins Monitoring
Performance Metrics
You can monitor Jenkins performance, all jobs, specific jobs, Java VMs, and Jenkins web access to stay on top of its performance.
Jenkins performance metrics
-
Node count
node_countrecords the total number of nodes. -
Health check count
health-check_countfetches the number of health checks associated. -
Health check duration
health-check_durationshows the rate at which the health checks are running in seconds. -
Nodes offline
nodes_offlinedenotes the number of offline nodes. -
Nodes online
nodes_onlinedenotes the number of online nodes. -
Projects count
projects_countcollects the total number of projects. -
Projects disabled
projects_disabledcollects the total number of projects that have been disabled. -
Projects enabled
projects_enabledcollects the total number of projects that are enabled. -
Queue size
queue_sizedenotes the total number of jobs in queue. -
Executor count
executor_countshows the number of executors available for Jenkins. -
Executors free count
executors_free_countshows the number of executors available for Jenkins that are not currently in use. -
Executors in use count
executors_inuse_countshows the number of executors that are in use. -
Queues pending
queues_pendingfetches the number of pending jobs in the queue. -
Queues stuck
queues_stuckfetches the number of jobs stuck in a queue. -
Queues blocked
queues_blockedfetches the number of jobs that are blocked in the queue -
Jobs in queue
jobs_in_queueshows the number of buildable items in a queue. -
Plugins active
plugins_activeshows the number of active plugins. -
Plugins failed
plugins_failedshows the number of failed plugins. -
Plugins inactive
plugins_inactiveshows the number of inactive plugins. -
Plugins with update
plugins_withupdateshows the number of plugins with a pending update. -
Builds blocked duration
builds_blocked_durationdenotes the time taken by the jobs in blocked state in seconds. -
Build creation time
build_creation_timedenotes the time taken for the build to complete. -
Builds execution duration
builds_execution_durationshows the build execution time in seconds. -
Builds queuing duration
builds_queuing_durationshows the build queuing time in seconds. -
Builds waiting duration
builds_waiting_durationdenotes the time the build waits in a queue in seconds.
All Jenkins job monitoring metrics
-
Job count
job_countfetches the number of jobs. -
Jobs scheduled rate
jobs_scheduled_ratedenotes the rate at which the jobs are scheduled in events per minute. -
Jobs blocked duration
jobs_blocked_durationdenotes the time taken by the jobs in the build queue in the blocked state in seconds. -
Jobs buildable duration
jobs_execution_timedenotes the time taken for job execution in seconds. -
Jobs execution time
jobs_execution_timedenotes the time taken for job execution in seconds. -
Jobs queuing duration
jobs_queuing_durationdenotes the time taken by the job in the build queue in seconds. -
Jobs total duration
jobs_total_durationdenotes the time taken by the job from entering the build queue to completing the build in seconds. -
Jobs waiting duration
jobs_waiting_durationdenotes the time the jobs spend in their quiet period in seconds.
Specific Jenkins jobs monitoring metrics
-
Build count
build_countfetches the number of builds in the job. -
Job last build queue ID
job_lastbuild_queueidfetches the queue ID of the last build. -
Job last build duration
job_lastbuild_durationdenotes the time taken for the last build in milliseconds. -
Job last build estimated duration
job_lastbuild_estimated_durationdenotes the estimated time for the last build in milliseconds. -
Job last build ID
job_lastbuildidfetches the ID of the last build. -
Job last build number
job_lastbuild_numberfetches the last build's number in the job. -
Build failed
build_failedfetches the number of builds that failed. -
Build success
build_successfetches the number of successful builds. -
Build aborted
build_abortedfetches the number of aborted builds.
Jenkins Java VM monitoring metrics
-
Blocked count
blocked_countdenotes the number of threads that are currently blocked. -
Total count
total_countdenotes the total thread count. -
Deadlock count
deadlock_countfetches the number of threads that have a currently detected deadlock. -
File descriptor ratio
file_descriptor_ratiodenotes the ratio of used to total file descriptors. -
Heap memory committed
heap_memory_committeddenotes the amount of heap memory, in bytes. -
Heap memory initiated
heap_memory_initiateddenotes the amount of heap memory that has been newly initiated, in bytes. -
Maximum heap memory
maximum_heap_memorydenotes the amount of heap memory that is currently in use, in bytes. -
Heap memory used
heap_memory_useddenotes the amount of memory outside the heap, in bytes. -
Non-heap memory committed
non-heap_memory_committeddenotes the amount of memory outside the heap, in bytes. -
Non-heap memory initiated
non-heap_memory_initiateddenotes the amount of memory outside the heap that has been newly initiated, in bytes. -
Maximum non-heap memory
maximum_non-heap_memorydenotes the maximum amount of memory outside the heap that is used, in bytes. -
Non-heap memory used
non-heap_memory_useddenotes the amount of memory outside the heap that is currently in use, in bytes. -
Total memory committed/p>
total_memory_committeddenotes the total amount of memory, in bytes. -
Total memory initiated
total_memory_initiateddenotes the total amount of memory that has been newly initiated, in bytes. -
Total maximum memory
total_maximum_memoryfetches the maximum amount of memory, in bytes. -
Total memory used
total_memory_usedfetches the total amount of memory used, in bytes. -
New threads
new_threadsdenotes the number of threads that have not currently started execution. -
Running threads
running_threadsdenotes the total number of threads that are currently in execution. -
Terminated threads
terminated_threadsdenotes the total number of threads that have completed execution. -
Suspended threads
suspended_threadsdenotes the total number of threads that have suspended execution. -
Waiting threads
waiting_threadsdenotes the total number of threads that are waiting for execution.
Jenkins web access monitoring metrics
-
Total active requests
total_activerequestsfetches he total number of requests that are currently active. -
Total bad request
total_badrequestfetches the total number of requests with HTTP/400 status code. -
Total response code created
total_responsecode_createdfetches the total number of requests with HTTP/201 status code. -
Total forbidden response code
total_forbidden_responsecodefetches the total number of requests with HTTP/403 status code. -
No content response code
noContent_responsecodefetches the total number of requests with HTTP/204 status code. -
Not found response code
notFound_responsecodefetches the total number of requests with HTTP/404 status code. -
Unmodified response code
unmodified_responsecodefetches the total number of requests with HTTP/304 status code. -
Success response code
success_responsecodefetches the total number of requests with HTTP/200 status code. -
Non-informational response code
non_informational_responsecodefetches the total number of requests with a non-information status code./p> -
Server errors response code
servererror_responsecodefetches the total number of requests with HTTP/500 status code. -
Service unavailable
service_unavailablefetches the total number of requests with HTTP/503 status code. -
Request duration
request_durationfetches the time taken to generate the corresponding code.
Setup
Prerequisites
- Download and install the Site24x7 server monitoring agent (Linux | Windows) in the server where you plan to run the plugin.
- Ensure you have Python 3 or a higher version installed on your server.
- Ensure that the Metrics plugin in Jenkins is installed and enabled. To check availability of the Metrics plugin, navigate to Jenkins > Manage Jenkins > Manage plugins > Available
- Generate your API key under the metrics section. To do this, navigate to Jenkins > Manage Jenkins > Configure system.
Plugin Installation
Follow the steps below to install the Jenkins plugin.
- Create a folder named jenkins.
- Download the jenkins.py and jenkins.cfg files from our GitHub repository and place them in the jenkins folder.
wget https://raw.githubusercontent.com/site24x7/plugins/master/jenkins/jenkins.py && sed -i "1s|^.*|#! $(which python3)|" jenkins.pywget https://raw.githubusercontent.com/site24x7/plugins/master/jenkins/jenkins.cfg
- To check if the plugin is working, execute the command below with appropriate arguments and check for a valid JSON output with applicable metrics and their corresponding values.
python jenkins.py --host "host" --port "port" --username "username" --password "password" --apikey "apikey"
- Add the applicable configurations in the jenkins.cfg file.
[jenkins]host="host"port="port"username="username"password="password"apikey="apikey"
- Follow the steps in this article to learn how to run the Python script on a Windows server. This isn't needed for Linux.
- Move the jenkins folder to the Site24x7 server monitoring plugin directory.
For Linux: /opt/site24x7/monagent/plugins/
For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins/
- Log in to Site24x7.
- Navigate to Plugins and click the required monitor.
Plugin Contribution
You can contribute to our existing plugins and come up with suggestions or feedback on our Community.
- Supported Platforms:
- Python Version: 2.7 & above
- Linux Agent Version:15.0.0 & above