Skip to main content

Jenkins Integration

Correlate failed builds and deployments with incidents. OpenSRE reads your Jenkins server over its REST API to answer: “was there a recent build or deployment that coincides with this alert?”

Commands

What the agent can do

During an investigation (or in chat), the agent can call these tools:
  • list_jenkins_builds — Recent builds for a job with status (SUCCESS / FAILURE / RUNNING / ABORTED) and timestamp.
  • get_jenkins_build_log — The console log for a specific build, to read the failing step or error.
  • get_jenkins_pipeline_stages — Per-stage status and duration for a Pipeline build (empty for freestyle jobs).
  • list_jenkins_jobs — All jobs with their last-build status.
  • list_jenkins_running_builds — Builds currently in progress across all jobs.

Setup

1. Create a Jenkins API token

In Jenkins: click your username (top-right) → SecurityAPI TokenAdd new TokenGenerate. Copy the token — Jenkins shows it only once. API access uses HTTP Basic auth with your username and this token (not your password).

2. Configure credentials

Either run the setup wizard:
You’ll be prompted for the Jenkins URL, username, and API token. Or use environment variables:
Folder-organized jobs are supported — pass the full path, e.g. team/payment-service.

3. Verify connectivity

A successful check reports the server it reached, e.g. Jenkins connectivity successful at http://localhost:8080 (node: built-in).

Example investigation

Provide the affected job name so the agent can pull its recent builds and logs:
The agent lists recent builds for the job, spots the failed one near the alert time, fetches its console log, and surfaces the failing step in the RCA.

API reference

Troubleshooting