---
title: GitHub Actions Setup for CI Visibility
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Continuous Integration Visibility > CI Pipeline Visibility in Datadog >
  GitHub Actions Setup for CI Visibility
---

# GitHub Actions Setup for CI Visibility

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}

## Overview{% #overview %}

[GitHub Actions](https://docs.github.com/actions) is an automation tool that allows you to build, test, and deploy your code in GitHub. Create workflows that automate every step of your development process, streamlining software updates and enhancing code quality with CI/CD features integrated into your repositories.

Set up CI Visibility for GitHub Actions to track the execution of your workflows, identify performance bottlenecks, troubleshoot operational issues, and optimize your deployment processes.

### Compatibility{% #compatibility %}

| Pipeline Visibility                                                                                                                              | Platform                            | Definition                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Running pipelines](https://docs.datadoghq.com/glossary/#running-pipeline)                                                                       | Running pipelines                   | View pipeline executions that are running. Queued or waiting pipelines show with status "Running" on Datadog.                                                                  |
| [CI jobs failure analysis](https://docs.datadoghq.com/continuous_integration/guides/use_ci_jobs_failure_analysis/)                               | CI jobs failure analysis            | Uses LLM models on relevant logs to analyze the root cause of failed CI jobs.                                                                                                  |
| [Partial retries](https://docs.datadoghq.com/glossary/#partial-retry)                                                                            | Partial pipelines                   | View partially retried pipeline executions.                                                                                                                                    |
| Logs correlation                                                                                                                                 | Logs correlation                    | Correlate pipeline and job spans to logs and enable job log collection.                                                                                                        |
| Infrastructure metric correlation                                                                                                                | Infrastructure metric correlation   | Correlate jobs to [infrastructure host metrics](https://docs.datadoghq.com/continuous_integration/pipelines/github/#correlate-infrastructure-metrics-to-jobs) for GitHub jobs. |
| [Custom tags](https://docs.datadoghq.com/glossary/#custom-tag) [and measures at runtime](https://docs.datadoghq.com/glossary/#measure)           | Custom tags and measures at runtime | Configure [custom tags and measures](https://docs.datadoghq.com/continuous_integration/pipelines/custom_tags_and_measures/?tab=linux) at runtime.                              |
| [Queue time](https://docs.datadoghq.com/glossary/#queue-time)                                                                                    | Queue time                          | View the amount of time pipeline jobs sit in the queue before processing.                                                                                                      |
| [Approval wait time](https://docs.datadoghq.com/glossary/#approval-wait-time)                                                                    | Approval wait time                  | View the amount of time workflow runs and workflow jobs wait for manual approvals.                                                                                             |
| [Custom spans](https://docs.datadoghq.com/glossary/#custom-span)                                                                                 | Custom spans                        | Configure custom spans for your pipelines.                                                                                                                                     |
| [Filter CI Jobs on the critical path](https://docs.datadoghq.com/continuous_integration/guides/identify_highest_impact_jobs_with_critical_path/) | Filter CI Jobs on the critical path | Filter by jobs on the critical path.                                                                                                                                           |
| [Execution time](https://docs.datadoghq.com/glossary/#pipeline-execution-time)                                                                   | Execution time                      | View the amount of time pipelines have been running jobs.                                                                                                                      |

The following GitHub versions are supported:

- GitHub.com (SaaS)
- GitHub Enterprise Server (GHES) 3.5.0 or later

### Terminology{% #terminology %}

This table shows the mapping of concepts between Datadog CI Visibility and GitHub Actions:

| Datadog  | GitHub Actions |
| -------- | -------------- |
| Pipeline | Workflow       |
| Job      | Job            |
| Step     | Step           |

## Configure the Datadog integration{% #configure-the-datadog-integration %}

### Configure a GitHub App{% #configure-a-github-app %}

The [GitHub Actions](https://docs.github.com/actions) integration uses a private [GitHub App](https://docs.github.com/developers/apps/getting-started-with-apps/about-apps) to collect workflow information. If you already have an app, you can skip to the next section.

1. Go to the [GitHub integration tile](https://app.datadoghq.com/integrations/github/).
1. Click **+ Create GitHub App**.
1. Configure the integration for a personal or organization account and enter the name of the GitHub organization.
1. Select the Datadog features you want to enable for the GitHub App.
1. In the **Edit Permissions** section, grant `Actions: Read Only` access.
1. Click **Create App in GitHub** to finish the app creation process on GitHub.
1. Give the app a name, for example, `Datadog CI Visibility`.
1. Click **Install GitHub App** and follow the instructions on GitHub.

### Configure CI Visibility for GitHub Actions{% #configure-ci-visibility-for-github-actions %}

After the GitHub App is created and installed, enable CI Visibility on the accounts and/or repositories you want visibility into.

1. In Datadog, navigate to [**Software Delivery** > **CI Visibility** > **Add a Pipeline Provider**](https://app.datadoghq.com/ci/setup/pipeline?provider=github) and select **GitHub**.
1. Click **Enable Account** for the account you want to enable.
1. Enable CI Visibility for the whole account by clicking the toggle next to **Enable CI Visibility**.
1. Alternatively, you can enable individual repositories by scrolling through the repository list and clicking the **Enable CI Visibility** toggle.

Pipelines appear immediately after enabling CI Visibility for any account or repository.

### Disable CI Visibility for GitHub Actions{% #disable-ci-visibility-for-github-actions %}

To disable the CI Visibility GitHub Actions integration:

1. Go to the [CI GitHub Settings](https://app.datadoghq.com/ci/settings/provider) page.
1. Choose the GitHub account that you want to disable CI Visibility for, and click **Account Enabled**.
1. Untoggle **Enable CI Visibility**, or choose which repository you want to disable it for individually.

### Collect job logs{% #collect-job-logs %}

The GitHub Actions CI Visibility integration also allows you to automatically forward workflow job logs to [Log Management](https://docs.datadoghq.com/logs/).

To enable job logs collection:

1. In Datadog, navigate to [**Software Delivery** > **CI Visibility** > **Add a Pipeline Provider**](https://app.datadoghq.com/ci/setup/pipeline?provider=github) and select **GitHub**.
1. Click **Enable Account** for the account you want to enable.
1. Enable Job Logs Collection for the whole account by clicking the toggle next to **Enable Job Logs Collection**.
1. Alternatively, you can enable individual repositories by scrolling through the repository list and clicking the **Enable Job Logs Collection** toggle.

Immediately after toggling logs collection, workflow job logs are forwarded to Datadog Log Management. Log files larger than 1 GiB are truncated.

Logs are billed separately from CI Visibility. Log retention, exclusion, and indexes are configured in [Log Management](https://docs.datadoghq.com/logs/guide/best-practices-for-log-management/). Logs for GitHub jobs can be identified by the `datadog.product:cipipeline` and `source:github` tags.

### Correlate infrastructure metrics to jobs{% #correlate-infrastructure-metrics-to-jobs %}

The GitHub Actions CI Visibility integration allows for correlation between infrastructure and jobs. To achieve this, ensure the [Datadog Agent](https://docs.datadoghq.com/agent) is running on the host where the jobs are executed. Depending on the configuration, additional steps might be required:

- For [Actions Runner Controller](https://github.com/actions/actions-runner-controller): No additional setup required. Due to limitations in the Datadog Agent, jobs shorter than the minimum collection interval of the Datadog Agent might not always display infrastructure correlation metrics. To adjust this value, see [Datadog Agent configuration template](https://github.com/DataDog/datadog-agent/blob/main/pkg/config/config_template.yaml) and change `min_collection_interval` to be less than 15 seconds.

- For other configurations: To correlate jobs with the hosts running them, ensure the GitHub runner name matches the machine's hostname.

To see the metrics, click on a job span in the trace view. A window opens with an **Infrastructure** tab displaying the host metrics.

### CI jobs failure analysis{% #ci-jobs-failure-analysis %}

If job logs collection is enabled, CI Visibility uses LLM models to analyze failed CI jobs based on relevant logs coming from GitHub Actions.

You can also add job failure analysis to a PR comment. See the guide on [using PR comments](https://docs.datadoghq.com/continuous_integration/guides/use_ci_jobs_failure_analysis/#using-pr-comments).

For a full explanation, see the guide on [using CI jobs failure analysis](https://docs.datadoghq.com/continuous_integration/guides/use_ci_jobs_failure_analysis/).

## Visualize pipeline data in Datadog{% #visualize-pipeline-data-in-datadog %}

The [**CI Pipeline List**](https://app.datadoghq.com/ci/pipelines) and [**Executions**](https://app.datadoghq.com/ci/pipeline-executions) pages populate with data after the pipelines finish.

The **CI Pipeline List** page shows data for only the default branch of each repository. For more information, see [Search and Manage CI Pipelines](https://docs.datadoghq.com/continuous_integration/search/#search-for-pipelines).

## Further reading{% #further-reading %}

- [Explore Pipeline Execution Results and Performance](https://docs.datadoghq.com/continuous_integration/pipelines)
- [Troubleshooting CI Visibility](https://docs.datadoghq.com/continuous_integration/troubleshooting/)
- [Extend Pipeline Visibility by adding custom tags and measures](https://docs.datadoghq.com/continuous_integration/pipelines/custom_tags_and_measures/)
- [Monitor your GitHub Actions workflows with Datadog CI Visibility](https://www.datadoghq.com/blog/datadog-github-actions-ci-visibility/)
