> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Jenkins

> Send Jenkins Pipeline build logs and traces to Sazabi with the Jenkins OpenTelemetry plugin, configured in the Jenkins UI or with Configuration as Code.

[All Jenkins integration capabilities](https://docs.sazabi.com/catalogs/integrations/jenkins)

## About

The [Jenkins OpenTelemetry plugin](https://plugins.jenkins.io/opentelemetry/) 2.0.0 and later can send [Pipeline build logs over OTLP](https://github.com/jenkinsci/opentelemetry-plugin/blob/main/docs/build-logs.md). Point the plugin at your Sazabi intake URL and the controller and agents send each Pipeline step's log lines to Sazabi as the build runs, together with the trace the plugin records for every build. No `Jenkinsfile` changes are needed.

> [!WARNING]
>
> Only Pipeline jobs send build logs. The plugin doesn't export Freestyle or Matrix job logs, or the Jenkins server's own logs.

Metrics are not stored by this source. Setup turns off the plugin's metrics export; use [OpenTelemetry Metrics](https://docs.sazabi.com/catalogs/log-sources/send-to-an-endpoint/opentelemetry-metrics.md) if you want Jenkins metrics.

## Prerequisites

* A Jenkins controller you administer, with the [OpenTelemetry plugin](https://plugins.jenkins.io/opentelemetry/) 2.0.0 or later installed
* Outbound HTTPS to your Sazabi intake host from the controller **and from every agent**. Agents send the log lines of the steps they run themselves.
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL)

## Set up in the dashboard

Both options set the same plugin settings. The configuration properties do four things:

* `otel.exporter.otlp.protocol=http/protobuf` — required. The plugin defaults to gRPC, which Sazabi's intake does not accept.
* `otel.logs.exporter=otlp` — turns on Pipeline build log export.
* `otel.logs.mirror_to_disk=true` — keeps each build log on disk too, so the Jenkins console still shows it.
* `otel.metrics.exporter=none` — turns off the plugin's Jenkins health metrics, which this source doesn't store.

**Step 1**

### Configure the OpenTelemetry plugin

> [tab] Jenkins UI
>
> Open **Manage Jenkins** > **System** (**Configure System** on older Jenkins) and scroll to the **OpenTelemetry** section.
>
> 1. Paste your intake URL into **OTLP Endpoint**, with no path.
>
> 2. Set **Authentication** to **No Authentication**. The public key is in the URL's hostname.
>
> 3. Click **Advanced** and paste this into **Configuration properties**:
>
>    ```properties theme={"system"}
>    otel.exporter.otlp.protocol=http/protobuf
>    otel.logs.exporter=otlp
>    otel.logs.mirror_to_disk=true
>    otel.metrics.exporter=none
>    ```
>
> 4. Click **Save**.

> [tab] Configuration as Code (JCasC)
>
> Merge this block into the YAML your [Configuration as Code](https://plugins.jenkins.io/configuration-as-code/) plugin loads, and replace `<your intake URL>` with the intake URL shown above:
>
> ```yaml title="jenkins.yaml" theme={"system"}
> unclassified:
>   openTelemetry:
>     endpoint: "<your intake URL>"
>     authentication: "noAuthentication"
>     configurationProperties: |-
>       otel.exporter.otlp.protocol=http/protobuf
>       otel.logs.exporter=otlp
>       otel.logs.mirror_to_disk=true
>       otel.metrics.exporter=none
> ```
>
> Apply it with **Manage Jenkins** > **Configuration as Code** > **Reload existing configuration**, or restart Jenkins.

**Step 2**

### Open the network path from agents

Pipeline steps that run on an agent send their log lines from that agent, not through the controller. Allow outbound HTTPS to your intake host from every agent pool, including ephemeral Kubernetes or cloud agents.

**Step 3**

### Hand off the change

If your Jenkins configuration is version-controlled (JCasC YAML, Helm values), commit it on a new branch, push it, and open a pull request. Otherwise apply it directly on the controller.

## Set up with the CLI

You can also register the Jenkins log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create jenkins --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and use it as the plugin's OTLP endpoint. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Run any Pipeline job, ideally one with a step on an agent. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm records from the **Jenkins** source appear within a minute or two.

## Troubleshooting

**Traces arrive but no build logs** — The plugin is older than 2.0.0, `otel.logs.exporter=otlp` is missing, or the job is a Freestyle or Matrix job.

**Steps on the controller log, steps on agents don't** — The agents can't reach your intake host. Open outbound HTTPS from the agent network.

**Nothing arrives** — Check the Jenkins log for export errors. The protocol must be `http/protobuf`, and the endpoint must be the full intake URL starting with `https://`, with no path. The **Noteworthy active configuration properties** row under **Advanced** shows the settings the plugin actually applied.

**The Jenkins console shows no log for new builds** — Add `otel.logs.mirror_to_disk=true` to the configuration properties.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.