The selected Datadog site () is not supported.

Overview

GitHub 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 tracing in GitHub Actions to track the execution of your workflows, identify performance bottlenecks, troubleshoot operational issues, and optimize your deployment processes.

Compatibility

Pipeline VisibilityPlatformDefinition
Running pipelinesRunning pipelinesView pipeline executions that are running. Queued or waiting pipelines show with status “Running” on Datadog.
Partial retriesPartial pipelinesView partially retried pipeline executions.
Logs correlationLogs correlationCorrelate pipeline and job spans to logs and enable job log collection.
Infrastructure metric correlationInfrastructure metric correlationCorrelate jobs to infrastructure host metrics for GitHub jobs.
Custom tags and measures at runtimeCustom tags and measures at runtimeConfigure custom tags and measures at runtime.
Queue timeQueue timeView the amount of time pipeline jobs sit in the queue before processing.
Approval wait timeApproval wait timeView the amount of time workflow runs and workflow jobs wait for manual approvals.
Custom spansCustom spansConfigure custom spans for your pipelines.

The following GitHub versions are supported:

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

Configure the Datadog integration

Configure a GitHub App

The GitHub Actions integration uses a private GitHub App to collect workflow information. If you already have an app, you can skip to the next section.

  1. Go to the GitHub integration tile.
  2. Click + Create GitHub App.
  3. Configure the integration for a personal or organization account and enter the name of the GitHub organization.
  4. Select the Datadog features you want to enable for the GitHub App.
  5. In the Edit Permissions section, grant Actions: Read Only access.
  6. Click Create App in GitHub to finish the app creation process on GitHub.
  7. Give the app a name, for example, Datadog CI Visibility.
  8. Click Install GitHub App and follow the instructions on GitHub.

Configure tracing 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 and select GitHub.
  2. Click Enable Account for the account you want to enable.
  3. Enable CI Visibility for the whole account by clicking the toggle next to Enable CI Visibility.
  4. 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 GitHub Actions tracing

To disable the CI Visibility GitHub Actions integration, make sure the GitHub app is no longer subscribed to the workflow job and workflow run events. To remove the events:

  1. Go to the GitHub Apps page.
  2. Click Edit > Permission & events on the relevant Datadog GitHub App (if you have multiple apps, you have to repeat the process for each).
  3. Scroll to the Subscribe to events section, and make sure that Workflow job and Workflow run are not selected.

Collect job logs

The GitHub Actions CI Visibility integration also allows you to automatically forwarding workflow job logs to Log Management.

To enable job logs collection:

  1. In Datadog, navigate to Software Delivery > CI Visibility > Add a Pipeline Provider and select GitHub.
  2. Click Enable Account for the account you want to enable.
  3. Enable Job Logs Collection for the whole account by clicking the toggle next to Enable Job Logs Collection.
  4. 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. Logs for GitHub jobs can be identified by the datadog.product:cipipeline and source:github tags.

Correlate infrastructure metrics to jobs

If you are using self-hosted GitHub runners, you can correlate jobs with the hosts running them by ensuring that the GitHub runner name matches the hostname of the machine. CI Visibility uses this information to link to infrastructure metrics.

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

Visualize pipeline data in Datadog

The CI Pipeline List and 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.

Further reading

PREVIEWING: rtrieu/product-analytics-ui-changes