What Is Build History in Jenkins?

What Is Build History in Jenkins?

A plain-English guide to the diary that Jenkins keeps of every build: what it records, where it lives, how to read it, how to clean it, and how to turn a long list of past runs into useful answers.

Every ship keeps a logbook. The captain writes down the time of departure, the weather, the route, and anything that went wrong. Months later, when someone asks, “Why were we late in March?”, the logbook holds the answer. Without it, everyone would only have vague memories and arguments. Jenkins keeps a logbook too, and it is called the build history. Every time a job runs, Jenkins adds a new page to the diary: which run it was, who started it, what code it used, how long it took, whether it worked, and every line of text it printed.

Most people glance at the build history without thinking about it. They see a column of little colored dots on the left of a page and move on. But that column is only the tip of a very useful iceberg. In this guide you will learn what build history is, what is stored in each entry, where the files live, how to read trends, how to find the exact build that broke something, and how to keep the diary from growing until it swallows the disk. Every new word is explained when it first appears, so you can read from top to bottom without stopping.

WWhat Is Build History?

Build history is the saved list of every past run of a job, together with the full record of what happened in each one.

Start with the basics. Jenkins is an automation server, a program that stays switched on and does tasks for you. A job is the saved description of a task, like a recipe. A build is one single run of that job, like one cooking session. Each build gets a number, such as #1, #2, #3, and the numbers only ever go up. The build history is the ordered collection of all those builds for a job, newest first, with a stored record for each.

On a job’s main page, Jenkins shows a panel titled Build History, usually on the left side. Each row shows the build number, a colored ball or icon for the result, and the time. Click any row and you open that build’s own page, with the console log, the changes, the test results, the artifacts, and more. So the build history is both a list and a doorway: a list you can scan, and a doorway into each detailed record.

Everyday Analogy

Think of a doctor’s file for one patient. Each visit adds a new page with the date, the symptoms, the tests, the result and the notes. The whole file is the history. Nobody reads every page each time, but when a problem appears, the doctor flips back to see when it started and what changed. A job is the patient, each build is a visit, and the build history is the file.

It is worth stressing what the history is not. It is not a backup of your code, and it is not a permanent archive of your releases. It is a working diary about the runs of your automation. Its greatest value is answering questions of the kind “what happened, when, and why?” quickly, without needing anyone to remember.

i
Tip

When something breaks, the build history is your first stop. Ask three questions in order: when did it last work, what changed since then, and did anything else change around the same time? The history can answer all three in minutes.

#1, #2, #3
numbers that never repeat
Newest first
the order of the list
1 page
of detail for every build

What is stored with every entry

Identity

Build number

The counter that identifies the run. It never repeats, even if older builds are deleted.

Result

Status

Success, unstable, failure, aborted or not built, shown as a colored ball.

Time

Start time and duration

When it began, how long it waited in the queue and how long it ran.

Cause

Who or what started it

A person, a code change, a timer, or another job.

Story

Console log

Every line of text the build printed, in order.

Input

Changes and parameters

The code changes included, and any options chosen at the start.

Output

Artifacts and test results

Saved files and reports that came from the run.

Place

Agent and workspace

Which machine ran it, and which folder it used.

HA Short History of the History

Keeping a record of every build was one of the earliest ideas in Jenkins, and it shaped how teams think about quality.

Before build servers, a failed compile was a private embarrassment. A developer saw an error on their own computer, fixed it, and nobody else ever knew. There was no shared record of how often builds broke, how long they took, or which changes caused trouble. When Hudson, later renamed Jenkins, began running builds on a shared server, it also began writing down the result of each run in a place everybody could see.

That simple change had a surprising cultural effect. A build failing in public, with a red ball and a name next to it, made teams care about keeping builds healthy. The history also allowed something new: trends. Instead of asking “does the build work?”, teams could ask “is the build getting slower?” and “are failures becoming more frequent?” The diary turned single events into a story over time.

Everyday Analogy

Think of a bathroom scale. Stepping on it once tells you today’s weight. Writing the number down every morning turns it into a chart, and the chart shows whether you are going up, going down or holding steady. Build history is the chart for your software delivery.

1

Private builds

Builds ran on individual computers, and results were seen only by the person who ran them.

2

Shared build server

Hudson runs builds centrally and shows a list of results to the whole team.

3

Trends and graphs

Duration and test result charts appear, so teams can watch health over time.

4

Retention rules

As servers filled up, discard rules were added so old records could be removed automatically.

5

Pipelines and stage views

History becomes richer, showing each stage of each run, not only one ball per build.

!
A note on the word history

Build history is about the runs of jobs. It is different from the history of changes to the settings of a job or of the Jenkins server, which needs a separate plugin, and different from the history of your code, which lives in Git. Keep the three ideas separate in your head.

CCore Concepts You Need to Know

A small set of ideas explains almost everything about build history. Learn them once and the rest is easy.

Recipe

Job

The saved definition of work. A job owns a build history.

Run

Build

One numbered execution of a job. One entry in the history.

Status

Result

The final outcome of a build, such as success, unstable or failure.

Text

Console log

The running text output of the build, the most detailed part of the record.

Link

Permalink

A stable address such as “last successful build” that always points to the newest matching run.

Rule

Build discarder

The retention rule that deletes old builds automatically.

Folder

JENKINS_HOME

The main folder on the controller where Jenkins keeps all its data, including build records.

Chart

Trend

A graph that shows how something, such as duration or test failures, changes from build to build.

The cast of characters

The controller is the main Jenkins server. It keeps the build history. The agent is a separate machine or container that actually runs a build. When a build runs on an agent, the agent sends its console output and results back to the controller, and the controller writes them into the history. That is why the history stays available even when the agent is a short-lived container that disappears the moment the build ends.

Everyday Analogy

Think of a courier company. The head office (controller) keeps the delivery ledger. Drivers (agents) go out and deliver parcels, and each one phones in the result. Even if a driver quits tomorrow, the ledger still shows every delivery they made. Build history lives in the head office, not with the driver.

i
Tip

Build numbers are unique per job, not across the whole Jenkins. Build 57 of the shop job and build 57 of the payment job are different builds. When talking to teammates, always say both the job name and the number.

AArchitecture: Where the History Lives

The diary is not kept in a database. It is kept in files on the controller, and this simple choice explains many behaviors.

flowchart LR
    Trigger["Trigger: code change, timer or click"] --> Ctrl["Jenkins Controller"]
    Ctrl --> Queue["Build Queue"]
    Queue --> Agent["Agent"]
    Agent -->|"console output and results"| Ctrl
    Ctrl --> Home["JENKINS_HOME on Controller Disk"]
    Home --> Job["Job Folder"]
    Job --> B1["Build 1 Record"]
    Job --> B2["Build 2 Record"]
    Job --> B3["Build 3 Record"]
    Ctrl --> UI["Job Page: Build History Panel"]
    Home --> UI
Figure 1: How a build’s record travels from the agent into the history on the controller.

Reading the diagram

Follow the arrows. A trigger starts a build, and the controller places it in the build queue. An agent runs it and sends the console output and results back over its connection. The controller writes these into the JENKINS_HOME folder, in a directory belonging to the job, and inside it a small folder for each build. When you open the job page, Jenkins reads those folders to draw the build history panel and each detailed page.

Files, not a database

Inside the job’s folder, there is a directory called builds, and inside it one folder per build number. Each build folder holds a few small files. One is an XML file that summarizes the build: its result, its start time, its duration and its causes. Another is the console log as plain text. Others hold changes, test results or pointers to archived artifacts. A small file in the job folder also remembers the next build number to use.

This design has clear benefits. Jenkins is easy to install, because no database is needed. Backups are simple, because copying the home folder copies everything. And you can inspect a record with an ordinary text editor if you must. It also has costs. Thousands of build folders on one disk can slow down pages that list them, and a large history means a large backup. This is why cleaning up old builds is not just tidiness. It is a performance and safety task.

!
The controller disk is precious

The build history shares its disk with job settings, credentials and plugins. If history and artifacts fill the disk, the whole Jenkins can stop. Set retention rules early, and watch free space.

The build number file

Jenkins remembers the next number to assign, so numbers never repeat, even after deletions. If you delete builds 1 to 50, the next run is still build 51 or later, not build 1. This is deliberate: an old link to “build 12” must never accidentally point to a different, newer run. If you ever need to reset numbering, it is a special, careful operation, and it is best avoided on jobs that other systems refer to.

RReading the Build History Panel

The panel on the job page is packed with small clues. Learning to read it quickly saves hours.

The rows

Each row shows a build number, a status ball and a time. Blue or green usually means success, yellow means unstable, red means failure, grey means aborted or not built, and a moving or flashing ball means the build is running right now. A small weather-like icon on the job list summarizes recent health, from sunshine when most builds pass to storms when most fail.

SignWhat it usually meansWhat to do
Blue or green ballThe build succeededNothing, unless the trend is worrying
Yellow ballUnstable: the run finished but a check, often tests, reported problemsOpen the test results
Red ballFailure: a step failed in a serious wayOpen the console log and find the first error
Grey ballAborted or not builtFind who or what stopped it
Animated ballThe build is running nowWatch the live log if needed
Long bar or repeated redsSlow builds or a broken streakLook at the trend graphs
Everyday Analogy

The panel is like the row of lights on a car dashboard. You do not read words. You notice colors and patterns. A single red light is a warning. A whole row of them is an emergency. With practice, you read the panel in a glance.

Searching and filtering

The panel includes a search box. You can type a build number, or part of a message, to jump to matching entries. This is handy on a job with thousands of builds, when scrolling would take forever. Some views also let you filter by result, for instance showing only failures, so you can see how often they happen.

Opening a single build

Click a row and you enter that build’s page. The left side lists useful links: the console output, the changes that went into it, test results, any artifacts, and actions such as replaying or rebuilding it. The top of the page states the cause, such as “Started by user Anita” or “Started by timer,” and the duration. Each of these is a small window into that moment of the past.

i
Tip

Always read the cause line. “Started by user” often means someone was testing something by hand, and a failure may be unrelated to the code. “Started by timer” tells you it was routine. “Started by upstream job” means another job’s success or failure led here.

LThe Life of a Build Record

A build’s entry in the history is created when the build begins and completed when it ends. Following that life shows where each piece comes from.

flowchart TD
    A["Trigger arrives"] --> B["Build number assigned"]
    B --> C["Queued: waiting time recorded"]
    C --> D["Started on an agent"]
    D --> E["Console log written line by line"]
    E --> F["Steps and stages run"]
    F --> G["Result decided"]
    G --> H["Reports, artifacts and changes attached"]
    H --> I["Record saved and shown in history"]
    I --> J{"Retention rule met?"}
    J -->|"Yes"| K["Record deleted"]
    J -->|"No"| L["Record kept"]
Figure 2: The life of one build record, from trigger to possible deletion.
1

Number assigned

As soon as the build is created, it receives the next build number and its cause is written down.

2

Queue time recorded

While it waits for a free executor, the wait is timed, so you can later tell queue delay from run time.

3

Live log

Once running, every line of output is streamed to the controller and appended to the console log, so you can watch it live.

4

Result decided

When the steps finish, Jenkins decides success, unstable, failure or aborted, and records the duration.

5

Extras attached

Test reports, archived files, code changes and fingerprints are linked to the record.

6

Retention decides its fate

Later, the discard rule may remove this record or its artifacts, or a person may mark it to keep forever.

Two clocks in every record

Every entry contains two time measurements beginners often mix up. Queue time is how long the build waited before any machine began it. Run time is how long it actually ran. If builds feel slow, the history helps you tell which clock is to blame. Long queue times point to too few agents or executors. Long run times point to the pipeline itself, where tuning may help.

i
Tip

Jenkins shows a live progress bar based on the durations of past builds. It is only an estimate, but it is drawn from your own history, so it becomes more accurate as the history grows.

TTrends: Turning a List into a Story

A single build tells you what happened once. A trend tells you where you are heading.

Jenkins can draw graphs across many builds. The most common are the build time trend, which shows how long each build took, and the test result trend, which shows how many tests passed, failed and were skipped in each build. Other plugins add graphs for code coverage, warnings, code size and more. These graphs come straight from the build history, so the longer the history, the more meaningful they become.

Everyday Analogy

Imagine tracking the time of your daily commute. One slow day means nothing, perhaps an accident. But if the graph shows the trip growing longer every week, something real has changed, such as new roadworks. Build trends work the same way. One slow build is noise. A rising line is a signal.

TrendWhat it showsWarning signTypical response
Build durationHow long each run tookA slow, steady climbParallelize stages, cache downloads, remove useless steps
Queue timeHow long builds waitedLong waits at busy hoursAdd agents or spread schedules
Success rateShare of builds that passA falling percentageFind the most common failure causes
Test countsPassed, failed and skipped testsFailures rising, or the total number droppingFix tests, and question why tests vanished
Flaky resultsTests that flip between pass and failRandom reds with no code changeQuarantine and repair unreliable tests
CoverageHow much code the tests exerciseCoverage sliding downwardAdd tests for new code

Reading the shape of a graph

  • A sudden jump often points to one specific change. Look at the builds on either side of the jump and read their change lists.
  • A slow climb usually means gradual growth, such as more tests or more data. It calls for planned tuning, not a hunt for a single culprit.
  • A sawtooth pattern that goes up and down regularly may reflect a cache being emptied, or a scheduled job competing for machines.
  • A flat line at zero failures for a very long time is usually good, but check that the tests still exist and still run.
!
Beware of broken measuring sticks

If the number of tests falls suddenly, the failure count may drop too, and the graph will look wonderful. Always read the totals as well as the failures. A great-looking trend built on deleted tests is a false comfort.

FFinding the Build That Broke Things

The most valuable use of build history is playing detective. Here is a repeatable way to find what went wrong and when.

Everyday Analogy

Suppose your house lights stop working. You ask, “When did they last work?” and “What did we do since?” Maybe you plugged in a new heater yesterday. The list of recent events narrows the search from the whole house to one socket. Build history lets you ask the same questions about your software.

1

Find the last good build

Scroll the history to the newest green or blue ball before the first red one. The boundary between them is your search area.

2

Find the first bad build

Open the first red build after that. Its console log shows the first error. This is the moment the problem began.

3

Read the changes

Open the changes list of the first bad build. It shows which code changes were added since the previous build, and who made them.

4

Check the environment

Did a tool version, an agent or a setting change at the same time? Compare which agent ran the good and bad builds.

5

Confirm and fix

Form a guess, test it, and either fix the problem or undo the change. Then watch the next builds turn green.

When several changes arrive together

Sometimes a single build contains many code changes, because they were merged during the quiet period, or because several people pushed at once. Then the first bad build has a long list of suspects. A useful trick is to build the suspect changes one by one, in a test branch, to find which one breaks. The history helps by telling you the exact range of changes to examine, so you never need to search the whole project.

When the failure is not the code

Not every red build is a code problem. Look for patterns in the history. If failures cluster on one agent, that agent may be sick. If they cluster at a particular hour, an outside service may be busy or a scheduled job may be competing for machines. If they appear and disappear with no change, a flaky test is likely. The history makes these patterns visible, and patterns point to causes.

A pattern spotted in the history

A team noticed that every third or fourth build failed on the same test, yet the code never changed. Looking at the history, they saw the failures all happened on one particular agent, which had less memory than the others. Adding memory to that agent removed the problem in an afternoon. Without the history, they might have chased the test for weeks.

DRetention: Deciding How Much History to Keep

History is valuable, but every record uses disk space. Retention rules balance memory against cost.

Left alone, Jenkins may keep every build forever. For a busy job that runs every few minutes, that means tens of thousands of records within a year. Each holds a log and sometimes large files. Sooner or later the disk fills or pages slow down. The cure is a build discarder, a rule that removes old builds automatically.

The choices

SettingWhat it doesGood for
Days to keep buildsDeletes builds older than a set number of daysTime-based retention, such as one month of history
Maximum number of builds to keepKeeps only the newest set number, and deletes the restBusy jobs, where count matters more than age
Days to keep artifactsDeletes only the saved files of older builds, keeping the recordLong history with short file storage
Maximum builds to keep with artifactsKeeps saved files for only the newest buildsControlling the heaviest part of the record
Keep this build foreverMarks one build to be skipped by cleanupRelease builds and important evidence
Everyday Analogy

Think of a wardrobe. Everyday clothes rotate out every season, so the cupboard never overflows. But the wedding outfit goes into a special box that is never thrown away. The discarder is the seasonal clear-out. The keep-forever mark is the special box.

A sensible starting point

Records and logs are small, while artifacts are large. So many teams keep a long record history and a short artifact history. For example, they might keep the last two hundred builds, but keep saved files for only the last twenty. Jobs that run very often may keep a smaller number, while release jobs keep everything, or better, copy the release files to a proper repository and let Jenkins forget them after a while.

!
Warning

Retention deletes evidence. Before shortening it, ask whether anyone needs old builds for audits, investigations or support. Regulated industries often must keep records for years, and Jenkins alone is not a good long-term vault. Export what you must keep to a system designed for long storage.

Global rules and defaults

Instead of setting a rule on every job, teams often apply a standard through shared templates, folder-level settings or configuration files. This prevents the common problem where new jobs are created with no retention at all, and go unnoticed until the disk alarm rings. Standard defaults are one of the cheapest and most effective habits.

MManaging the History by Hand

Besides automatic rules, Jenkins lets you tend the history with your own hands. Each action has good uses and small dangers.

Protect

Keep this build forever

Marks one build so cleanup skips it. Use it for releases and evidence, and use it sparingly.

Remove

Delete a build

Removes one record and its files. Useful for a build that leaked a secret or holds mistaken data.

Repeat

Rebuild

Starts a new build with the same parameters as an old one. The old record stays untouched.

Experiment

Replay

Reruns a pipeline build with an edited script, without changing the repository, for quick trials.

Describe

Edit build information

Adds a display name or description to a build, such as a version number, so it is easier to spot in the list.

Stop

Abort a running build

Cancels a build that is stuck or no longer needed. The record shows it as aborted.

Display names and descriptions

A list of numbers is hard to read. Was the release build number 431 or 432? Jenkins lets a build carry a display name and a description. A pipeline can set them automatically, for instance to the version number and the branch. Then the history panel shows meaningful labels, and a glance is enough to find the right entry. This small habit makes the history far more useful, especially for release jobs.

Deleting with care

Deleting a build cannot be undone, and it leaves a gap in the numbers. Do it only when there is a real reason, such as a leaked secret. If the build is referenced by other jobs, through artifacts or fingerprints, check before deleting. When in doubt, mark it as kept, or leave it for the retention rule to handle.

i
Tip

If a secret appears in a console log, deleting the build is only the first step. The secret is still valid until you rotate it. Treat any leaked secret as compromised, change it, and then clean up the record.

BBeyond One Job: Overview Pages and Dashboards

A single job’s history answers questions about one job. Teams also need a wider view across many jobs.

The global build history

Jenkins offers a page that combines builds from many jobs into one timeline. It shows which jobs ran, when, and how long they took, laid out on a horizontal time axis. This view is excellent for spotting crowding: a moment when many jobs overlap and compete for machines, or a quiet gap when machines sit idle. It answers questions like “why was everything slow at nine?” in a single glance.

Views and dashboards

Jenkins lets you group jobs into views, tabbed lists that show each job’s latest status and weather icon. Plugins add dashboards that display the build state on a large screen in the team room, often in bright colors, so a broken build is impossible to miss. Some show only failing jobs, and some show who is responsible.

The history of one machine

Every agent also has its own build history, listing the builds that ran on it. This is a hidden gem. If one agent seems to cause trouble, its history shows all its builds side by side, and you can see whether it fails more than its neighbors.

Everyday Analogy

Think of an airport board. Each airline keeps its own list of flights, but the airport shows all flights on one big screen, so staff can see crowding at a glance. The per-job history is the airline’s list, and the global view is the airport board.

ViewAnswers the questionBest used by
Job build historyWhat happened in this job, and when?The team that owns the job
Global timelineWhich jobs overlapped, and where are the crowds?Administrators and platform teams
Agent historyWhat ran on this machine, and how did it go?Anyone chasing machine-specific trouble
Views and dashboardsWhich jobs are red right now?Whole teams, on a shared screen
Metrics in a monitoring toolHow are success, duration and queue changing over months?Managers and platform teams

PPipelines and Stage Views

In pipeline jobs, the history goes deeper than one ball per build. Every stage of every run can be seen.

A pipeline divides a build into stages, named phases such as Build, Test and Deploy. Jenkins can draw a grid where each row is a build and each column is a stage, with a colored box in every cell. At a glance you see that Compile passed on every build, Test failed on builds 61 and 63, and Deploy was skipped on several. The average time for each stage appears at the top of its column, so you can see which stage is the slowest.

flowchart LR
    subgraph Build60["Build 60"]
        A1["Compile: pass"] --> A2["Test: pass"] --> A3["Deploy: pass"]
    end
    subgraph Build61["Build 61"]
        B1["Compile: pass"] --> B2["Test: fail"] --> B3["Deploy: skipped"]
    end
    subgraph Build62["Build 62"]
        C1["Compile: pass"] --> C2["Test: pass"] --> C3["Deploy: pass"]
    end
Figure 3: A stage view shows every stage of every build, so a failure has an address.

Reading the diagram

Each box group is one build, and inside it the stages run from left to right. In build 60, everything passed. In build 61, Compile passed but Test failed, so Deploy was skipped, which is the fail-fast behavior. In build 62, everything passed again. A failure now has an address: build 61, stage Test. That is far more precise than “the build is red.”

Why stage views help

  • Faster diagnosis. You open the log of the failed stage, not the whole log.
  • Bottleneck spotting. The slowest stage stands out, so tuning effort goes where it counts.
  • Pattern spotting. A stage that fails often, such as an integration test that depends on an outside service, becomes obvious.
  • Shared understanding. Non-experts can follow a colored grid far more easily than a long text log.
i
Tip

Give stages clear, stable names. If you rename a stage, its old history may appear under the old name, splitting the story. Choose good names early and keep them.

SSecurity and Privacy of Build History

A build history is a detailed diary. Anyone who can read it may learn a lot, so it deserves care.

Everyday Analogy

Think of a company’s visitor book and internal memos. Some are open to all staff, but memos about salaries are locked away. A build history is full of memos: server names, folder paths, error messages and sometimes worse. Deciding who may read which diary is an important part of good housekeeping.

RiskWhy it mattersHow to reduce it
Secrets in console logsAnyone who can read the log can read the secret, and it stays there as long as the recordUse the credentials store, which masks values, and never print secrets
Too many readersConfidential jobs may expose internal detailsUse permissions so only the right roles can view builds
Who can delete historyDeleting records can hide mistakes or wrongdoingLimit delete rights to a few trusted people and keep audit records
Untrusted contributionsStrangers’ builds may print or upload harmful contentBuild outside contributions on isolated agents with no secrets
Personal information in logsTest data may include real customer detailsUse fake test data and scrub logs
Old records kept too longMore old data means more chances of exposureSet retention rules and delete what is not needed

Audit trails

Build history is also an audit trail: a record of who ran what and when. Auditors and security teams value it because it can prove that a release passed its tests, and show who approved it. For this reason, some teams protect history from tampering, and export important records to systems that cannot be edited. Treat the history as evidence, and protect it as you would other evidence.

!
Warning

Jenkins masks stored credentials in logs by replacing them with stars, but it cannot hide a secret that a script prints in some other way. Review scripts that echo variables, and be careful with debug modes that print everything.

OMonitoring and Performance of the History Itself

The history helps you watch your builds, but the history also needs watching. Its size affects how fast Jenkins feels.

Everyday Analogy

A filing cabinet works well when it holds a few hundred folders. With a hundred thousand, finding anything takes a long time, and the floor may give way. The build history is a filing cabinet too. Good housekeeping keeps it quick and safe.

What to watchWhat it tells youTypical action
Free disk space on the controllerHow close you are to troubleAlert early and tighten retention
Builds stored per jobWhich jobs have the largest historiesSet or reduce discard rules
Size per build recordWhether logs or artifacts are bloatedShorten logs, trim artifacts
Page load time for job pagesWhether large histories slow the interfaceReduce the number of kept builds
Startup time of JenkinsWhether loading many records slows a restartClean up old builds and jobs
Backup size and durationWhether history makes backups heavyBack up smartly, and prune history

Long console logs

A build that prints millions of lines creates a huge log, slows the browser when viewed, and consumes storage. Common causes are tools set to verbose mode, or loops that print in every step. Keep logs meaningful: print progress and errors, not every detail. Some plugins can compress or trim logs, and larger teams ship logs to a dedicated logging system where they are searchable and can be stored more cheaply.

Metrics tools

Jenkins can publish numbers about itself through plugins for popular monitoring systems. A common setup lets Prometheus, a widely used metrics collector, gather figures such as build counts, durations and results, while Grafana draws charts and raises alerts. This gives you months of trends that survive even when old builds are deleted, because the numbers live in the monitoring system, not in the Jenkins folder. It is a wise way to keep a long-term view without a heavy history.

i
Tip

Keep long-term statistics in a metrics system and short-term details in Jenkins. That way you can delete old records with a clear conscience, while your yearly charts remain intact.

AAdvantages, Disadvantages and Trade-offs

Build history is a gift that comes with upkeep. Knowing both sides helps you use it wisely.

Advantages

  • A full record of what happened, when and why, available in seconds
  • Makes it easy to find the first bad build and its changes
  • Trends reveal slow decay that no single build would show
  • Acts as an audit trail for releases and approvals
  • Helps spot machine or time-of-day patterns behind failures
  • Supports rebuild and replay of past runs
  • Works out of the box, with no database to run

Disadvantages

  • Stored on the controller’s disk, which can fill and slow Jenkins
  • Large histories make pages, restarts and backups heavier
  • Old records may hold secrets or personal data
  • Deleting builds is permanent and leaves gaps
  • Not designed as long-term archive storage
  • Numbers alone can mislead if tests are removed or logs are noisy

Trade-offs to think about

More vs less

How much to keep

Longer history helps investigations and audits but costs space and speed. Keep records longer than files.

Detail vs noise

Log verbosity

Detailed logs help debugging but bloat storage. Print what a future reader will need.

Open vs private

Who may read

Open history helps learning. Restricted history protects secrets. Match access to sensitivity.

Inside vs outside

Where trends live

Jenkins shows quick trends, while a metrics system keeps years. Use both.

Auto vs manual

Cleanup style

Automatic rules are steady and forgetful. Manual keeps are precise but must be remembered. Combine them.

Job vs global

Scope of view

Per-job history explains one job. Global views explain crowding and load.

DDesign Patterns and Anti-patterns

A pattern is a proven way to solve a common problem. An anti-pattern is a habit that looks fine and causes pain later.

Patterns worth copying

Pattern

Default retention everywhere

Apply standard discard rules through templates so no job is left unbounded.

Pattern

Meaningful build names

Set display names and descriptions such as version and branch, so the history reads like a story.

Pattern

Long records, short files

Keep many small records and few large artifacts.

Pattern

Keep releases elsewhere

Copy release files to a repository, and keep the Jenkins record as evidence.

Pattern

Trends in a metrics system

Send numbers to a monitoring tool so long-term charts do not depend on old builds.

Pattern

Stable stage names

Keep stage names steady so history stays comparable over time.

Pattern

Owner on every job

Name someone responsible, so red streaks are noticed and fixed.

Habits to avoid

ANTI-PATTERN 01Avoid
What it looks like

No discard rule is set on any job. Builds run every few minutes for years, and nobody ever looks at disk space.

Why it hurts

The disk fills, pages slow down, restarts take forever, and one day Jenkins stops. Rescuing it is stressful, and deleting things in a hurry is risky.

Do this instead

Set default retention from the start, watch free space, and clean up before it becomes an emergency.

ANTI-PATTERN 02Avoid
What it looks like

The team treats Jenkins as the permanent home of all release records and files, with years of history on one disk.

Why it hurts

A single disk failure or careless cleanup erases proof of every release ever shipped.

Do this instead

Export important records and files to long-term storage with its own backups.

ANTI-PATTERN 03Avoid
What it looks like

A build fails, someone clicks rebuild, it passes, and nobody writes down why the first run failed.

Why it hurts

The hidden problem, perhaps a flaky test, stays alive and returns at a worse time. The history shows a green ball but hides the lesson.

Do this instead

Add a short description to the failed build, name the cause, and track repeated failures.

ANTI-PATTERN 04Avoid
What it looks like

Nobody reacts to red balls. The job stays red for weeks, and the team says, “Oh, that one is always red.”

Why it hurts

When red is normal, new real failures are invisible, and trust in the system fades.

Do this instead

Fix or revert quickly, and name an owner. A broken job should be a team priority.

ANTI-PATTERN 05Avoid
What it looks like

Scripts echo environment variables and debug output into the console log, including passwords and tokens.

Why it hurts

Anyone who can read the history can read the secrets, and they remain there as long as the record does.

Do this instead

Use the credentials store, avoid printing secrets, and review logs of sensitive jobs.

BBest Practices and Common Mistakes

These are lessons experienced teams usually learn the hard way. You can learn them the easy way, by reading them now.

Best practices

  • Set retention on day one. Decide how many builds and how many days to keep before the disk fills.
  • Keep records longer than files. Logs and results are small, artifacts are large.
  • Name builds meaningfully. Use display names and descriptions such as version and branch.
  • Read the trends weekly. Look at duration, success rate and flaky tests, and pick one improvement at a time.
  • Use stage names that never change. Stable names keep history comparable.
  • Keep logs meaningful. Print progress and errors, not every detail.
  • Never print secrets. Use the credentials store and review scripts.
  • Export what you must keep. Move releases and audit evidence to long-term storage.
  • Watch the controller disk. Alert at a comfortable level, such as seventy or eighty percent.
  • Record why builds failed. A short note beats a rerun that hides the cause.
  • Give every job an owner. A name on the page makes red builds get fixed.

Common mistakes

  • Keeping everything forever. It is easy at first and painful later.
  • Deleting history in a hurry. Emergency cleanups often remove the very evidence you need.
  • Trusting a green trend without checking totals. Removed tests can make failure counts look wonderful.
  • Ignoring queue time. Slow feedback is sometimes waiting, not running.
  • Assuming Jenkins is the archive. It is a working diary, not a vault.
  • Giving everyone delete rights. Records can vanish by accident.
  • Leaving personal data in logs. Test data with real customer details can leak through history.
  • Renaming stages casually. The history splits into two stories.

Using history in team reviews

Some of the best uses of build history happen away from the keyboard. Many teams hold a short review every week or two, and the build history is the main exhibit. They ask a few simple questions. How many builds failed this week, and what were the top causes? Which job is the slowest, and did it get slower? How long did it take, on average, to fix a broken build? Which flaky tests appeared again? Each answer comes straight from the history. The team then picks one improvement, such as parallelizing a slow stage or repairing a flaky test, and checks next week whether the numbers moved. Over months, this small ritual turns the history from a passive diary into a steady engine of improvement.

History of settings is a separate story

People often ask, “Who changed this job’s settings, and when?” The build history cannot answer that, because it records runs, not edits. A separate plugin can keep a history of configuration changes, showing who edited what and letting you compare versions. Keeping job settings in pipeline files stored in Git gives the same benefit for free, since Git records every change with an author and a date. Together, the three histories tell a complete story: Git says what changed in the code and the recipe, the configuration history says what changed in the server, and the build history says what happened when things ran.

i
Tip

Once a quarter, review your biggest jobs. Ask, “How many builds do we keep? How big is each? Does anyone still need the oldest ones?” That one meeting prevents most storage emergencies.

A worked example: history rules for one small team

Imagine a team of eight building a web shop. Their main job runs on every code change, roughly a hundred times a day. They decide to keep the newest three hundred builds, which is about three days of history, plus any build marked as kept. Artifacts are kept for only the newest thirty builds. Every night, a scheduled job runs the full test suite, and its history is kept for ninety days, because those results are useful for trend charts. Release builds are named with the version number, marked to keep forever, and their files are copied to a repository. Metrics such as duration and success rate flow to a monitoring tool, so yearly charts survive even as old builds are deleted. Finally, an alert fires when the controller disk passes seventy percent full.

Notice what this plan achieves. Every kind of record has a life span that matches its usefulness. The disk stays healthy. Releases are protected. Long-term trends are preserved elsewhere. And nobody has to remember to clean anything by hand.

TTroubleshooting: When the History Misbehaves

Sometimes builds vanish, pages crawl or numbers look strange. A calm routine finds the cause quickly.

1

Check retention first

Missing old builds are usually the discard rule working as designed. Compare the missing builds’ age with the settings.

2

Check disk space

A full disk causes strange failures, including builds that cannot save their records. Free space before anything else.

3

Check who deleted what

If records vanished unexpectedly, check permissions and audit records for manual deletions.

4

Check the size of the history

If pages are slow, count the builds and look at log sizes. A few giant logs or tens of thousands of records are common causes.

5

Check the trend data

If graphs look odd, verify that tests were not removed, stages were not renamed, or a plugin was not changed.

Common situations and their usual causes

SymptomLikely causeWhat to check
Old builds are missingRetention rule deleted themDiscarder settings, keep-forever marks
Build number jumpedBuilds were deleted, or another job with a shared counterDeletion records, retention
Job page loads slowlyVery large history or huge logsNumber of builds kept, log sizes
Jenkins takes long to startMany records and jobs to loadCleanup, number of old jobs
Builds fail to save resultsDisk is full or a permission problemFree space, folder permissions
Test trend suddenly improvesTests were removed or skippedTotal test count, skipped count
Stage history looks splitA stage was renamedPipeline stage names over time
Log is too long to openVerbose tool or looping printsTool settings, script loops
i
Tip

Before you delete anything in a panic, take a copy of the home folder or at least a snapshot of the disk. Most cleanup regrets come from deleting records that someone needed.

RReal-World and Industry Examples

Every serious engineering team leans on build history, often without noticing. Here is how the ideas show up in practice.

Large engineering organizations

Companies with thousands of developers run huge numbers of builds each day. They keep detailed history for a short time and push summary numbers to monitoring systems for long-term charts. Platform teams study those charts to decide where to add machines or speed up shared pipelines.

Regulated industries

Banks, hospitals and telecom providers must often show that a release passed its checks and who approved it. Build history, with its causes, results, approvals and logs, forms the evidence. Because Jenkins is a working diary, these teams export the key records to systems that keep them for years.

Open-source projects

Public projects often expose their build history to everyone. Contributors see at a glance whether their change broke the build, and users see whether the latest nightly is healthy. The history becomes part of the project’s public face.

Quality and test teams

Test engineers watch trends for flaky tests. A test that flips between pass and fail across many builds, with no code change, is marked for repair. Without history, such tests are almost impossible to prove.

Platform and operations teams

When the whole server feels slow, operators open the global timeline. They see many jobs crowded at the same hour, then spread schedules with the hash symbol, or add agents. The history shows them the crowd that no single job could reveal.

Small teams and startups

A team of five may never look at a chart. But when a deployment breaks on Friday, they open the history, find the last green build, read the changes since, and roll back within minutes. That single use repays the effort of setting it up.

Lessons that repeat across teams

Look across these examples and a few lessons appear again and again. Successful teams treat the history as a tool, not as clutter. They read trends, not only single results. They keep detailed records briefly and summary numbers long. They protect secrets and control who may delete. They give builds meaningful names so the story reads clearly. And they set retention before the disk makes them. None of this needs a large budget. A small team can follow every one of these habits from the first week.

A build history is a team’s memory. Tend it well, and the past will answer the questions of the future.

FFrequently Asked Questions

Q1What is build history, in the simplest words?
It is the saved list of every past run of a job, newest first, with a detailed record of each run: its number, result, time, cause, changes, log and files.
Q2Where is build history stored?
In files on the controller, inside the Jenkins home folder. Each job has a folder, and inside it a small folder for each build. Jenkins does not use a traditional database for this.
Q3Does build history disappear if an agent is deleted?
No. The agent only runs the build and sends results back. The controller keeps the record, so it stays even when a short-lived container is gone.
Q4Why are my old builds missing?
Most likely a build discarder rule removed them, or someone deleted them by hand. Check the retention settings and any keep-forever marks.
Q5Do build numbers ever repeat?
No. The number always goes up, even after builds are deleted, so an old reference such as “build 57” never points to a different run.
Q6How many builds should I keep?
It depends on how often the job runs and how long you need the evidence. Many teams keep a few hundred records, a much smaller number of artifacts, and protect release builds separately.
Q7How can I keep one important build forever?
Open the build and use the option to keep it forever. Cleanup rules will then skip it. Use this for releases, and copy the release files to a proper repository as well.
Q8How do I find which build broke something?
Find the newest good build and the first bad build after it, then read the changes list of the first bad build. Also compare agents and environment, in case the code is not the cause.
Q9What is the difference between failure and unstable in the history?
Failure is a hard stop, such as a compile error. Unstable means the build finished, but a quality check, usually tests, reported problems.
Q10Can I add labels to builds so they are easier to find?
Yes. A build can carry a display name and a description, such as the version and branch. Pipelines can set them automatically, which makes the history much easier to read.
Q11Why is my job page slow?
A very large history, or a few enormous console logs, can slow pages. Reduce the number of kept builds, shorten logs, and keep artifacts on external storage.
Q12Is build history the same as the history of my code?
No. Code history lives in Git and records changes to files. Build history lives in Jenkins and records runs of your automation. They are linked, because each build notes which code it used.
Q13Is it safe to keep console logs forever?
Only if they contain no secrets or personal data. Logs are read by many people and remain as long as the record does. Use the credentials store, avoid printing secrets and set sensible retention.
Q14How can I keep long-term statistics without keeping old builds?
Send build numbers such as duration and success rate to a monitoring system. The charts then survive even after old builds are deleted from Jenkins.
Q15Does deleting a build also delete its artifacts?
Yes. Deleting a build removes its record and the files stored with it. If other jobs depend on those files, check first, or keep the build instead.
Q16Can I see who changed a job’s settings from the build history?
No. Build history records runs, not edits. Use a configuration history plugin, or keep the pipeline recipe in Git, where every change has an author and a date.
Q17How can I compare two builds?
Open both build pages and compare their changes, parameters, agents, durations and logs. For test results, the trend and comparison views show which tests changed between the two runs.

SSummary and Key Takeaways

Build history is the logbook of your automation. Read it well and it answers almost every “what happened?” question.

Key Takeaways

  • What it is: Build history is the ordered list of every past run of a job, each with its own numbered record of result, time, cause, changes, log, tests and files.
  • Where it lives: In plain files on the controller’s disk, inside the Jenkins home folder, one folder per build. This is simple and easy to back up, but large histories slow pages and fill disks.
  • How to read it: Colored balls give a quick health picture. Open a build to see the cause, console log, changes and results, and use trends to see the direction over time.
  • How to investigate: Find the last good build and the first bad one, read the changes between them, then check agents, timing and environment before blaming the code.
  • How to keep it healthy: Set a build discarder on day one, keep records longer than artifacts, mark releases to keep, and watch free disk space with early alarms.
  • How to make it useful: Give builds meaningful names, keep stage names stable, keep logs meaningful, and send long-term numbers to a monitoring system.
  • How to protect it: Never print secrets, control who can read and delete history, export important records to long-term storage, and treat the history as audit evidence.