Skip to main content
Version: Cloud

Monitor Jenkins

Overview

The Jenkins plugin enhances the ability to monitor Jenkins operations, providing a comprehensive perspective on nodes by collecting node information, metrics, event reports, job performance data, and their real-time statuses.

This plugin facilitates automated forwarding of metrics and service checks to APM Snappyflow (leveraging Elasticsearch and Kafka). It simplifies the process of gaining insight into the Jenkins CI/CD pipeline in four steps:

  1. Gathering Data from Jenkins.

  2. Indexing and Storing Data in Snappyflow (utilizing Elasticsearch and Kafka).

  3. Visualization through Snappyflow Dashboards.

  4. User Alerting.

Prerequisite

To collect the metrics of the plugin it is necessary to have the below details.

  • APM host URL and Port.

  • Create a project and application in SnappyFlow APM and generate profile key.If you've already created these, you can utilize the existing information.

  • Snappyflow APM requires the auth token, kafka path and kafka topic details (The SnappyFlow team will provide these details).

Configuration

Steps to Add SnappyFlow Plugin

  1. Open the Jenkins dashboard and select Manage Jenkins option.

  2. In the Plugins section, go to Available Plugins and search Maplelabs APM.


  3. Select the Maplelabs APM option and install the plugin.

  4. Once the installation is complete, restart Jenkins.

Steps to Add Plugin onfiguration

To configure the SnappyFlow Jenkins plugin:

  1. Go to the Manage Jenkins > System Configuration section.

  2. In the System Configuration section, select the System option.

  3. In the System window, scroll down and go to APM Maplelabs Plugin section and add the following details:

  4. Give the details of Host: Target url, Port: Port number and Protocol: Protocol used for communication details.


  5. Provide the snappyflow details like Snappyflow Project Name, Snappyflow Application Name, SnappyFlow Instance Name and Profile.


  6. Select SnappyFlow Kafka and give following details: taken, Path, and Kafka Topic.


  7. Check the check boxes of Enable Event Reporting and Enable Metric Reporting. Give a Metrics Reporting Interval in minutes.


  8. Select Save and Apply button.

  9. The data will be shown in SnappyFlow dashboard after the time interval mentioned in the Jenkins.

  10. If any change in the reporting interval is made, Jenkins must be restarted to apply the changes.

View Jenkins Metrics

Follow the below steps to view the metrics collected from Jenkins.

  1. Go to the Application tab in SnappyFlow and navigate to your Project > Application > Dashboard.
  2. You can view the APIGateway metrics in the Metrics section.
note

Once the configuration is complete, the plugin will be automatically detected within the Metrics section. However, if the plugins are not detected, you can import template to view the corresponding metrics and events.


  1. To access the unprocessed data gathered from the plugins, navigate to the Browse data section and choose the Index: Metric, Instance: Endpoint, Plugin, and Document Type.

Template Details

TemplatePluginDocument TypeDescription
MetricsJenkinsjobMetrics, nodeMetrics, systemMetricsCollects metrics from Jenkins.
EventsJenkinsjobEvents, systemEvents, securityEventsCollects event information from Jenkins.

Metric List

System Metrics
MetricDescription
project_totalTotal No. of projects on the Jenkins Instance.
plugin_totalTotal Plugins Installed on Jenkins Instance.
plugins_activeCount of active plugins.
plugins_failedCount of failed plugins.
plugins_inactiveCount of inactive plugins.
plugins_updatableCount of updatable plugins.
Node Metrics
MetricDescription
nodeNameName of the Node.
executorCountNo. of executors on the node.
freeNo. of free executors.
inUseNo. of inUse executors.
connectTimeConnect Time of this Node.
swap_total_in_GBTotal number of swap space in GB.
swap_available_in_GBAvailable swap space in GB.
memory_total_in_GBTotal physical memory of the system, in GB.
memory_available_in_GBThe available memory of the system's total physical memory, in GB.
disk_pathThe path that was checked.
disk_available_GBAvailable Disk size in GB.
temp_pathMonitors the disk space of "/tmp" path.
temp_available_GBAvailable size of "/tmp" in GB.
response_timeComputes the average response time, by taking the time out into account.
archDiscovers the architecture of the system.
nodes_totalTotal Nodes available.
Job Metrics
MetricDescription
queue_sizeNo. of items in queue
queue_stuckNo. of items stuck in queue starving for an executor for too long
queue_buildableNo. of items waiting the executor to become available
queue_blockedNo. of items blocked because another build is in progress, required Resources are not available or otherwise blocked by Queue.Task.isBuildBlocked()
queue_pendingNo. of items currently pending execution
jobs_startedNo. of jobs started (History of jobs)
jobs_abortedNo. of jobs aborted
jobs_completedNo. of jobs completed
Job Events
MetricDescription
onStartedNotifies the start of a build.
onCompletedNotifies the completion & status of a build.
System Events
MetricDescription
onOfflineCalled right after a computer went offline.
onTemporarilyOfflineIndicates that the computer was marked as temporarily offline by the administrator.
onTemporarilyOnlineIndicates that the computer was marked as temporarily online by the administrator.
onLaunchFailureCalled when an agent attempted to connect via ComputerLauncher but it failed.
Security Events
MetricDescription
userCreatedNotifies User creation.
authenticated2Fired when a user was successfully authenticated using credentials.
failedToAuthenticateFired when a user tried to authenticate but failed.
loggedInFired when a user has logged in.
failedToLogInFired when a user has failed to log in.
loggedOutFired when a user logs out.

Enable Alerts and Notofications

To set alerts and notifications for Jenkins plugin click here.