Monitoring pipelines

Viewing your builds and logs

All pipeline activity in Codefresh can be viewed on the Builds tab. There is one global view from the left-side menu that shows builds for all projects across your organization and a project-based view from the settings inside an individual project.

Both views have the same controls and filters.

Viewing pipeline status

Each screen contains all builds sorted from the most recent to the oldest. The first time you visit the screen there are no filters defined.

Pipeline Activity in Codefresh

Pipeline activity

By default, it shows all builds that is happening in Codefresh. To narrow the list you can use the filters on the top of the screen.

Applying filters on the build view

Directly above the list you can find several filters.

At the most basic level you can choose between

  • Running builds that are currently executing
  • Pending builds which are queued and waiting to start
  • Delayed builds which cannot run yet, because there are no free pipeline builders.
    A build can be delayed for a maximum of seven days, and each account can have up to 1000 delayed builds at any time.
    • Builds that are delayed for more than seven days are terminated with a Delay time limit exceeded reason.
    • If the total number of delayed builds exceed 1000, older builds are terminated with a Maximum delayed workflows exceeded reason.
  • All builds regardless of running stage (this is the default)

You can further filter the builds by choosing the various filter types that specify the build job.

Pipeline filters in Codefresh

Available filters

The available filters are:

  • Pipeline - any of the pipelines available.
  • Provider - type of Git provider.
  • Repository - Git repository from the attached trigger.
  • Type - build, launch a test environment.
  • Branch - any of the available branches from the attached Git trigger.
  • Committer - person that made the commit that triggered the build.
  • Environment - which environment was affected.
  • Status - success, error, in-progress, pending, terminated etc. A Pending status can also indicate that pipeline build execution has been paused for the account.
  • Trigger type - what type of trigger was responsible for this build
  • Git event - in the case of git triggers the exact event

Notice that all filters are multiple-choice so you can select multiple values for each filter category. At any given point you can see all the active filters on top of the screen.

Pipeline filters in Codefresh

Active filters

You can easily remove active filters, by clicking on them and adding/removing values.

On the right hand side you can also find a filtering toolbar with time options:

Filtering options for time

Filtering options for time

You can combine all previously mentioned filters with the time based filters.

Creating build views

Once you have a set of filters that you use regularly, you can save them as a custom Build View by clicking the Save as View button and providing a name.

Now you can select at the top of the window any of the available build views to automatically filter results according to the respective sets of filters.

Build View selection

Build View selection (click to enlarge)

You can delete existing build-views by clicking on the manage views button. You can change the filters of an existing build view by making a new filter selection and then saving the view with an existing name (effectively overwriting it).

Build details

For each individual build you can see several details such as the git hash, the person who made the commit, the pipeline that was triggered as well as how much time it took. For each event type you will also see additional context related information.

build details in Codefresh

Build details

Child builds triggered by other builds are identified in the Event column by the icon .
The Parent Build column shows the link to the parent build. Mouse over to see the tooltip with information on the parent build. The tooltip includes links to the parent build, repo, branch, commit message, and the ability to filter by repo and branch.

Child build in Builds list

Child build in Builds list

There are also extra options if you click the small “3-dot” menu button on the right. For a particular build, you can:

Notice that if you restart a pipeline it will trigger with the exact settings it originally had. So if this was a manual trigger where you disabled caching or changed the notification options, the new execution will still honor those settings (even if you have changed them for later builds).

An extra button for test reports will be visible if you are using the test report feature of Codefresh.

Viewing details for an individual pipeline build

If you click on any individual pipeline build, you will enter the pipeline build information screen. From here you can see more details for a build such as the logs, running time and resource metrics.

Pipeline view

Pipeline view

Each section in this screen corresponds to each pipeline step. There are two special steps:

  • Initializing Process
  • Cloning Main Repository

These are Codefresh built-in steps and will appear for most builds (you can also create a pipeline that doesn’t clone a git repository by default). The rest of the step names depend on your codefresh.yml (or the default step names provided by Codefresh). The different columns take the names from the defined pipeline stages.

Viewing status for pipeline steps

Monitor the status of the steps in the pipeline as they are executed.

Step Status Icon Description
Pipeline step completed successfully.
Pipeline step pending approval has been approved, either manually or automatically.
Pipeline step pending approval has been denied approval.
Pipeline step currently running.
Pipeline step running in debug mode. See Debugging pipelines for more information.
Pipeline step gracefully terminating execution.
Pipeline step execution has been manually or automatically terminated.
Pipeline step execution has been terminated because of error.

Viewing/downloading logs for builds and build steps

View logs for running and completed builds and download them in HTML or text formats.
You can view logs online, for the entire build or for single or specific steps in the build. Similarly, you can download the logs for the entire build, or for single or specific steps.
The Filter Logs option is useful to view and manage logs, especially for large builds as there is a max size limit for logs. You can also search logs.

Note:
The max log size for the entire build is 100MB, and 20MB per step. The system stops generating logs once the build size is exceeded. For large builds, it is easier to filter the logs by single or multiple steps, and then view/download them.

  1. In the Builds page, select a build.
  2. To view logs online for the selected build, click Output in the lower part of the Build page.
  3. Optional. Select Filter Logs and then select the step or steps for which view/download logs.
    Logs are displayed for the selected steps.
  4. From either the context menu on the top-right of the toolbar or from the Output pane, select Download as HTML or Download as text. The log file is downloaded with the build ID as the filename, including also the step name if the log is for a single step, in the format `<build-id-'.

Build log in Codefresh

Build log in Codefresh

Viewing variables in pipeline builds

Variables, both system (environment) and custom (user-defined), are injected into pipelines from different sources and at different levels.
The variables actually used by a specific build of the pipeline varies according to the events that triggered the pipeline.
Select a build to view all its variables, and identify their source, and overrides if any.

  1. In the Builds page, either select the build and then open the context-menu, or open the context-menu on the right of the build entry.
  2. Select Variables.

Variables option in context menu of build entry

Variables option in context menu of build entry
  1. If required, click the Sort icon for the group to sort in alphabetical order.
  2. To copy the group’s variables to the clipboard, click the Copy icon.

Here’s an example of the list of variables for a pipeline build.

List of variables in selected build

List of variables in selected build

The variables are grouped by granularity, starting with the global project-level variables and ending with the trigger-level variables with the highest granularity:

  • Project
  • Shared configuration
  • Pipeline
  • Trigger

A variable with a strikethrough indicates an override by the same variable in a lower-level group. For rules on precedence and overrides for variables in builds, see Variables.

Notes:

  • Variables exported across steps with cf_export are not identified as cf-exported variables in the list.
  • Secret-type variables are always masked.

Reviewing the yaml for the pipeline

From the step details you can also click on the yaml tab to see the yaml segment for that individual step:

Step Yaml

Step Yaml

If you want to see the yaml for the whole pipeline,

  • Click the YAML tab on the bottom left corner without selecting a step first or
  • Select the three dots next to the “RESTART” button on the top-right, and click on Show YAML

Pipeline Yaml

Pipeline Yaml

In both cases you can copy to clipboard the yaml shown using the button at the top left corner.

Viewing pipeline metrics

Codefresh offers several metrics for the pipeline, and for steps in the pipeline, that allow you to get a better overview of the resources consumed by your pipeline.

Pipeline metrics

At the most basic level, Codefresh displays quick metrics while the pipeline is running that include memory consumed and size of logs:

Metrics for running pipeline

Metrics for running pipeline
  • To view memory and disk usage for running or completed pipeline builds, click the Metrics tab at the bottom of the Build page.

    • Memory usage: View memory usage (Y-axis) by time (X-axis) for the duration of the build.
    • Disk usage: View disk usage (Y-axis) by time (X-axis) for the duration of the build. The red line is set at 90% of the maximum disk space.
      To see the precise usage at different points in time, mouse over the dots.
      Viewing the actual disk usage for a build during its run allows you to better gauge and define the minimum disk space required for the build volume.

Detailed metrics for pipelines

Detailed metrics for pipelines

Pipeline-step metrics
For step-specific metrics, first select the step, and then click the Metrics tab. Step metrics are available for memory and CPU usage (not disk space).

Step metrics

Step metrics

Restarting the pipeline

You can choose to restart any pipeline by clicking the button at the top right corner.

Restart a pipeline

Restart a pipeline

It is important to note that “Restart from beginning” will restart a pipeline with the same state that it had in its original execution (including the original git commit). If you want to execute a pipeline again with a new state instead, you need to use the Run button in the pipeline editor and selecting any of the available triggers.

If the pipeline has failed, you can choose to restart it only from the failed step and onwards.

You can also restart from a failed step right from the graphical view:

Restart from a failed step

Restart from a failed step

Notice again that restarting a pipeline from a failed step means restarting the pipeline with the same state that it had at the point in time (including the original git commit).

If your pipeline has some flaky steps, you can also use the retry syntax in your yaml instead of restarting them manually each time they fail.

Monitoring Pipelines outside the Codefresh UI

You don’t always have to be in the Codefresh UI in order to monitor the status of your builds.

Monitoring Pipelines that check Pull requests

One of the most important roles of a CI platform is to automatically update the status of a GIT Pull request with the result of the respective build.

Pull Request Status

Pull Request Status (click image to enlarge)

If you have setup a GIT trigger in Codefresh then by default this happens automatically without any other configuration for all automated commits (that are coming from webhooks).

If you start a build manually then by default the git status will not be updated (i.e. the result of the pipeline will not affect the status of Pull request)

If you don’t want this behavior to happen, you can enable the git status update checkbox when you launch a pipeline.

Update git status for pipelines triggered manually

Update git status for pipelines triggered manually (click image to enlarge)

This way the pipeline status will change the build status even with manual builds.

The same behavior is also available to the Codefresh CLI. In that case use the parameter --enable-notifications to specify if manually triggering a build will also change the GIT status.

For open source projects you also have the ability to trigger builds from external forks.

Viewing Pipeline status from text/html files

Codefresh also supports build badges that allow you to show the status of a Pipeline in Text files or web pages.

Codefresh build badges

Codefresh build badges

See the build badges page for more information.