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 Link GitHub Account.
  3. Follow the instructions to configure the integration for a personal or organization account.
  4. In Edit Permissions, grant Actions: Read access.
  5. Click Create App in GitHub to finish the app creation process GitHub.
  6. Give the app a name, for example, Datadog CI Visibility.
  7. 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. Go to the Getting Started page and click on GitHub.
  2. Click on Enable Account for the account you want to enable.
  3. Enable CI Visibility for the whole account by clicking 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.

Enable log collection

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

Note: Log collection is not available for PCI-compliant organizations.

To enable logs, follow these steps:

  1. CI Visibility settings ページに移動します。
  2. 有効になっている、またはリポジトリを有効にしているアカウントをクリックします。
  3. アカウント全体のログを有効にするには、Enable Job Logs Collection をクリックします。
  4. また、リポジトリリストをスクロールして、Enable Job Logs Collection トグルをクリックすると、個々のリポジトリを有効にすることができます。

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

Note: Logs are billed separately from CI Visibility. Log retention, exclusion, and indexes are configured in Logs Settings. Logs for GitHub jobs can be identified by the datadog.product:cipipeline and source:github tags.

インフラストラクチャーメトリクスとジョブの相関付け

セルフホスト型の GitHub ランナーを使用している場合は、ジョブとそれを実行しているホストを関連付けることができます。これを行うには、GitHub ランナー名が実行されているマシンのホスト名と一致することを確認します。CI Visibility はこれを利用して、インフラストラクチャーのメトリクスにリンクします。メトリクスを見るには、トレースビューでジョブスパンをクリックすると、ウィンドウ内にホストメトリクスを含む Infrastructure という新しいタブが表示されます。

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.

GitHub Actions のトレースを無効にする

CI Visibility GitHub Actions のインテグレーションを無効にするには、GitHub アプリがワークフロージョブおよびワークフロー実行イベントのサブスクリプションを終了していることを確認します。イベントを削除するには

  1. GitHub Apps のページに移動します。
  2. 該当する Datadog GitHub アプリの Edit > Permission & events をクリックします (複数のアプリがある場合は、それぞれのアプリでこのプロセスを繰り返す必要があります)。
  3. Subscribe to events セクションまでスクロールし、Workflow job および Workflow run が選択されていないことを確認します。

参考資料

PREVIEWING: alai97/reorganize-some-sections-in-dora-metrics