Configure the Jenkins data source
This document explains how to configure the Jenkins data source. For query instructions, refer to the Jenkins query editor.
Before you begin
Before configuring the data source, ensure you have:
- Grafana permissions: The
Organization administratorrole. - Installed plugin: The Jenkins data source plugin is installed. Refer to Install and upgrade the Jenkins data source plugin.
- Jenkins prerequisites: A Jenkins instance with the Remote Access API enabled, and credentials if the instance requires authentication.
Add the data source
To add the data source:
- Click Connections in the left-side menu.
- Click Add new connection.
- Type
Jenkinsin the search bar. - Select Jenkins.
- Click Add new data source.
Connection
Configure the connection to your Jenkins instance.
Authentication
If your Jenkins instance requires authentication, provide the following credentials. The data source uses HTTP basic authentication.
To read more about the Jenkins Remote Access API, refer to the Jenkins documentation.
Private data source connect
The Jenkins data source supports Private Data Source Connect (PDC), which lets Grafana Cloud query a Jenkins instance on a private network.
When the Secure Socks Proxy feature is enabled in your Grafana environment, an Enable Secure Socks Proxy toggle appears in the data source configuration. Enable it to route the data source connection through the proxy to your private network.
Verify the connection
Click Save & test to verify the connection. When the connection succeeds, Grafana displays Data source is working. If the connection fails, Grafana displays Unable to connect to Jenkins followed by the error details.
To make Jenkins the default data source for new panels and queries, click Make default at the bottom of the configuration page, next to Save & test.
Provision the data source
You can define the data source in YAML files as part of Grafana’s provisioning system. For more information, refer to Provisioning Grafana data sources.
Here’s a provisioning example for this data source:
apiVersion: 1
datasources:
- name: Jenkins
type: grafana-jenkins-datasource
access: proxy
jsonData:
url: https://ci.jenkins.io
username: <USERNAME>
secureJsonData:
password: <PASSWORD>You can also provision the data source with Terraform using the grafana_data_source resource:
resource "grafana_data_source" "jenkins" {
type = "grafana-jenkins-datasource"
name = "Jenkins"
json_data_encoded = jsonencode({
url = "https://ci.jenkins.io"
username = "<USERNAME>"
})
secure_json_data_encoded = jsonencode({
password = "<PASSWORD>"
})
}The Jenkins data source reads the instance URL from jsonData.url, so set the URL inside json_data_encoded rather than the resource’s top-level url argument.


