Jenkins
Introduction
Collects real-time health, performance, and operational metrics from Jenkins. Monitors job status, build results, node health, executor utilization, queue state, and plugin inventory via the Jenkins REST API.
Getting Started
Compatibility
Jenkins >= 2.x. Tested on Linux (Ubuntu, RHEL, CentOS, Debian, Amazon Linux) and Docker/Kubernetes.
Data Collection Method
vuSmartMaps collects Jenkins metrics through two complementary inputs: *REST API (Telegraf HTTP input): Polls Jenkins REST API endpoints for job status, node health, queue state, and plugin inventory. *Prometheus scrape (Telegraf Prometheus input): Scrapes the Jenkins Prometheus metrics endpoint for counters and gauges exposed by the Prometheus plugin.
Both inputs are required.
Prerequisites
Inputs for Configuring Data Source
- Data Source Name: The display name for this Jenkins data source.
- Jenkins Server URL: Enter the full base URL of the Jenkins server. Example: http://jenkins-host:8080. Omit the trailing slash.
- Prometheus Endpoint URL: Full URL of the Jenkins Prometheus metrics endpoint. Example: http://jenkins-host:8080/prometheus/ This is used by the Telegraf Prometheus input to scrape counters and gauges.
- Poll Interval (seconds): How frequently Prometheus metrics are scraped. Recommended: 60–300 seconds.
- Authentication Method: Select the authentication method for Jenkins REST API access: • No Authentication — no credentials required • Basic — enter a username and password or API token • Bearer — enter a bearer token
- Username: Jenkins username for API authentication. Shown only when Basic is selected.
- Password / API Token: Jenkins password or API token. Recommended: use an API token instead of your account password. Generate at: Jenkins > User > Configure > API Token
- Bearer Token: Bearer token for Jenkins API authentication. Shown only when Bearer is selected.
Firewall Requirement
To collect data from this O11ySource, ensure the following ports are opened:
| Source IP | Destination IP | Destination Port | Protocol | Direction |
|---|---|---|---|---|
| vuSmartMaps agent | Jenkins Server | 8080 (or custom port) | TCP | Inbound |
*Before providing the firewall requirements, please update the port based on the customer environment.
Configuring the Target
Ensure the Jenkins REST API and Prometheus endpoint are both accessible. Create a Jenkins user with Read access or use an API token.
REST API endpoints used:
- /api/json — jobs
- /computer/api/json — nodes
- /queue/api/json — queue
- /pluginManager/api/json — plugins
Prometheus endpoint:
- /prometheus/ — metrics (requires Prometheus plugin)
Verify REST API access: curl -u USERNAME:API_TOKEN http://JENKINS_HOST:8080/api/json
Verify Prometheus endpoint: curl http://JENKINS_HOST:8080/prometheus/
Configuration Steps
- Add Jenkins as a data source in vuSmartMaps.
- Enter the Jenkins Server URL (example: http://jenkins-host:8080). Do not include a trailing slash.
- Enter the Prometheus Endpoint URL (example: http://jenkins-host:8080/prometheus/). This is the URL scraped by the Telegraf Prometheus input.
- Select an Authentication Method: No Authentication, Basic, or Bearer.
- If Basic is selected, enter your Username and Password or API token. If Bearer is selected, enter your Bearer Token. Recommended: use an API token rather than your account password. To generate one, go to Jenkins > User > Configure > API Token.
- Save — the agent automatically collects jobs, nodes, queue, and plugin data.
Metrics Collected
The metrics are based on the input data collected.
