Set up Tracing on GitHub Actions Workflows
The selected Datadog site () is not supported.
Compatibility
Supported GitHub versions:
- GitHub.com (SaaS)
- GitHub Enterprise Server (GHES) 3.5.0 or newer
Partial pipelines: View partially retried and downstream pipeline executions
Logs correlation: Correlate pipeline spans to logs and enable job log collection
Infrastructure metric correlation: Correlate infrastructure metrics to pipeline jobs for self-hosted GitHub runners
Custom tags and metrics at runtime: Configure custom tags and metrics at runtime for pipeline spans
Queue time: View amount of time workflow jobs sit in the queue before processing
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.
- Go to the GitHub integration tile.
- Click Link GitHub Account.
- Follow the instructions to configure the integration for a personal or organization account.
- In Edit Permissions, grant
Actions: Read
access. - Click Create App in GitHub to finish the app creation process GitHub.
- Give the app a name, for example,
Datadog CI Visibility
. - Click Install GitHub App and follow the instructions on GitHub.
After the GitHub App is created and installed, enable CI Visibility on the accounts and/or repositories you want visibility into.
- Go to the Getting Started page and click on GitHub.
- Click on Enable Account for the account you want to enable.
- Enable CI Visibility for the whole account by clicking Enable CI Visibility.
- 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 the Logs Product.
To enable logs, follow these steps:
- Go to the CI Visibility settings page.
- Click on any account that is enabled or has enabled repositories.
- Click Enable Job Logs Collection to enable logs for the whole account.
- 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 Logs. Note that logs are billed separately from CI Visibility. Log retention, exclusion, and indexes are configured in Logs Settings.
Log files larger than 1GiB are truncated.
Correlate infrastructure metrics to jobs
If you are using self-hosted GitHub runners, you can correlate jobs to the host that is running them. To do this, make sure the GitHub runner name
matches the hostname of the machine it is running on. CI Visibility uses this to link to
infrastructure metrics. To see the metrics, click on a job span in the trace view and in the window a new tab named Infrastructure is
shown which contains the host metrics.
Visualize pipeline data in Datadog
The Pipelines and Pipeline Executions pages populate with data after the pipelines finish.
Note: The Pipelines page shows data for only the default branch of each 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:
- Go to the GitHub Apps page.
- Click Edit > Permission & events on the relevant Datadog GitHub App (if you have multiple apps, you will have to repeat the process for each).
- Scroll to the Subscribe to events section, and make sure that Workflow job and Workflow run are not selected.
Further reading
Additional helpful documentation, links, and articles: