---
title: Monitor Jenkins with OpenTelemetry and New Relic
source: https://docs.newrelic.com/docs/infrastructure/other-infrastructure-integrations/monitoring-jenkins-ot
---

Monitor Jenkins with the [OpenTelemetry plugin](https://plugins.jenkins.io/opentelemetry) by visualizing jobs and pipeline executions as [distributed traces](https://docs.newrelic.com/docs/distributed-tracing/concepts/introduction-distributed-tracing). You can also install the [quickstart](https://newrelic.com/instant-observability/jenkins) to get a pre-built dashboard to monitor your Jenkins pipeline.

![Screenshot showing sample Jenkins dashboard in New Relic](https://docs.newrelic.com/images/opentelemetry_screenshot-full_jenkins-05.webp "Screenshot showing sample Jenkins dashboard in New Relic")

## Prerequisites [#prerequisites]

You need to first install the OpenTelemetry plugin from Jenkins:

1.  Log into Jenkins.
2.  From the Dashboard, click on **Manage Jenkins**.
3.  Under System Configuration, click **Plugins**.
4.  Click the **Available plugins** tab, then search for **OpenTelemetry**.
5.  Select the **OpenTelemetry** checkbox, and **Install without restart**.
6.  Once the installation is complete, click **Manage Jenkins**.
7.  Under **System Configuration**, click **System**.
8.  Scroll down and check for a section called **OpenTelemetry**. If you can't see it, restart Jenkins.

![Screenshot showing Jenkins OpenTelemetry plugin](https://docs.newrelic.com/images/opentelemetry_screenshot-full_jenkins-01.webp "Screenshot showing Jenkins OpenTelemetry plugin")

## Configuration [#configuration]

You need a New Relic [OTLP endpoint](https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/opentelemetry-setup/#note-endpoints) and an license key to configure the Jenkins OpenTelemetry plugin to send data to New Relic.

![Screenshot showing Jenkins OpenTelemetry configuration](https://docs.newrelic.com/images/opentelemetry_screenshot-full_integrations-jenkins-02.webp "Screenshot showing Jenkins OpenTelemetry configuration")

1.  Enter an OTLP endpoint. For example, `https://otlp.nr-data.net:4317`.
2.  For authentication, select **Header Authentication**:
    a. In the **Header Name** field, enter **api-key**.
    b. In the **Header Value** field, enter a secret text containing your New Relic ingest license key.
3.  Save the changes.

If you don't have a secret text created with your New Relic license key, click the **+ Add** button and select **Jenkins Credentials Provider**, to create one. You can keep the default values except for **kind** and **secret** and the **description** is optional.

![Screenshot showing Jenkins Credential Provider](https://docs.newrelic.com/images/opentelemetry_screenshot-full_integrations-jenkins-03.webp "Screenshot showing Jenkins Credential Provider")

1.  From the **Kind** dropdown, select **Secret text**.
2.  In the **secret** field, enter your New Relic ingest license key.
3.  Optionally, add a description to note what the secret text is for.

## Validation [#validation]

Run a job or create a new pipeline to see Jenkins data in New Relic. Here's how to build a pipeline:

1.  Log into Jenkins and click **New Item**.
2.  Enter an item name, click **Pipeline**, and then **OK**.
3.  Scroll down to the very bottom to the **Pipeline** section.
4.  Use the Pipeline script, and select an option from the **try sample Pipeline...** dropdown.
5.  Click Save.
6.  In the newly created pipeline, click **Build Now**.
7.  Got to **[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > APM & services > Services - OpenTelemetry > jenkins**.
8.  Click **Distributed tracing** to visualize jobs and pipeline executions.
9.  Click **Logs** to see your Jenkins console logs. If there are no logs, check to make sure the environment variable `OTEL_LOGS_EXPORTER="otlp"` is set.

![Screenshot showing Jenkins OpenTelemetry plugin](https://docs.newrelic.com/images/opentelemetry_screenshot-full_opentelemetry-jenkins-04.webp "Screenshot showing Jenkins OpenTelemetry plugin")

## Install the Jenkins quickstart dashboard [#quickstart]

After you've sent your Jenkins pipeline data to New Relic, you can also easily monitor your jobs and pipeline executions with the prebuilt dashboard from [New Relic Instant Observability](http://newrelic.com/instant-observability). Get started in minutes with a pre-built dashboard to see key metrics in a consolidated view:

1.  Go to the Jenkins quickstart in [New Relic Instant Observability](https://newrelic.com/instant-observability/jenkins), and click **+ Install now**.
2.  Select an account and click **Begin installation**.
3.  If you've already completed the [validation](#validation), select **done** to move onto the next step.
4.  The quickstart deploys the resources to your account. Click **see your data** to get to the dashboard.
    If your service name (OTEL_SERVICE_NAME) is configured as something other than jenkins, update the WHERE conditions of entity.name on the prebuilt dashboard to use the configured service name.

![Jenkins quickstart dashboard in New Relic](https://docs.newrelic.com/images/opentelemetry_screenshot-full_jenkins-05.webp "Jenkins quickstart dashboard in New Relic")

> #### ⚠️ IMPORTANT
>
> The Jenkins OpenTelemetry plugin is not maintained by New Relic, so if you have any issues with the instrumentation, [create a new issue in the plugin's GitHub repo](https://github.com/jenkinsci/opentelemetry-plugin/issues).

## Resource attributes and tags [#attributes]

You can add resource attributes to the Jenkins plugin configuration. This allows you to include attributes for all the plugin generated log, metric, and trace data. Resource attributes that have names starting with `tags.` will also add entity [tags to your Jenkins entity](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-best-practices-resources/#tags).

You can define attributes in two ways:

**Define attributes in the Jenkins plugin configuration**

You can add the resource attributes to the `configurationProperties` element in the `io.jenkins.plugins.opentelemetry.JenkinsOpenTelemetryPluginConfiguration.xml` file.

Example:

````xml
<configurationProperties>
  otel.resource.attributes=attribute1=value1,attribute2=value2,tags.tag1=tagValue1
</configurationProperties>
```

````

**Define attributes in the environment variables**

You can define the resource attributes using the `OTEL_RESOURCE_ATTRIBUTES` environment variable.

This could be done on an Ubuntu system via editing the systemctl configuration for jenkins using `systemctl edit jenkins` and adding to the override.conf portion of the configuration:

````yml
[Service]
# Set OTel Environment Options
Environment="OTEL_RESOURCE_ATTRIBUTES=attribute1=value1,attribute2=value2,tags.tag1=tagValue1"
```

````
