Set up the GitHub integration to configure GitHub Apps and GitHub Actions, secure access for your repositories, and collect advanced telemetry (such as audit logs, vulnerability reports, secret scanning, and repository statistics).
You can use the Datadog source code integration to see code snippets in your stack traces, link stack traces to source code in GitHub for your Lambda functions, show test result summaries from pull request comments in CI Visibility, and access multiple service definitions in GitHub from the Service Catalog.
Follow these instructions to install GitHub Apps and grant permissions to Datadog. Depending on the permissions granted, you can set up the source code integration, see code snippets in stack traces, view collected telemetry such as audit logs, access GitHub Actions in CI Visibility, and more.
Link a repository in your organization or personal account
If you are an admin in your GitHub organization, you can configure GitHub Apps.
In the GitHub integration tile, navigate to the Repo Configuration tab.
Click Link GitHub Account to create a new GitHub App.
In Configure, either select Organization and enter a name for your organization, or select Personal Account.
Optionally, specify the URL of your GitHub Enterprise Server instance (version 2.22 or above) and ensure Datadog servers can connect to your Enterprise instance. Server IPs are available in the Webhooks section of IP Ranges.
In Edit Permissions, enable Datadog read permissions for issues, pull requests, and contents. You must select at least one permission.
Click Create App in GitHub, then you are prompted to enter a GitHub App name in GitHub.
Enter a name in the GitHub App name field and click Create GitHub App.
In the Configuration tab, click Install GitHub App and Install & Authorize.
Your GitHub App displays in the integration tile. To enable inline code snippets in stack traces, see Setting Up Source Code Integration.
If you have granted your GitHub App read permissions for issues and pull requests, GitHub issues and pull requests automatically generate a preview hoverbox with details including the commit history, author, and date in Notebooks.
- Navigate to Notebooks > New Notebook.
- Add a Text cell and mention an issue or pull request on GitHub in the Edit field, for example:
- Click Done, then the GitHub icon appears next to your linked issue or pull request.
- Click Connect to Preview and Authorize.
- Hover over the linked issue or pull request to see the description preview.
Audit logs encompass all activities and events across a GitHub organization. Upon an application’s installation, allow for Organization Administration permissions to have read access. This enables the application to begin collecting GitHub’s audit stream as logs on behalf of the GitHub organization.
To opt-out of collecting Audit Logs, find the corresponding organization in the Telemetery tab on the GitHub integration tile, click the toggle for Audit Log collection, and click Update Account.
For more information about Audit Logs, see the GitHub documentation for Audit log actions and Setting up streaming to Datadog.
The GitHub integration collects Code Scan Alert and Secret Scan Alert metrics. These metrics provide an overview of the organization’s Alert state by categorizing their state, repo, and secret type. They also provide long-term insights on Alert trends and their general progress.
|Github Code Scan Alerts|
Shown as alert
|Github Secret Scan Alerts|
Shown as alert
To start collecting these metrics, select the respective permissions for read access upon the application’s installation. To opt-out of Code Scan or Secret Scan metrics, find the corresponding organization in the Telemetery tab on the integration tile, click the toggle for the respective sections, and click Update Account.
Follow these instructions to configure webhooks in GitHub and Datadog, allowing events to appear in the Events Explorer.
Add a webhook in GitHub
In your GitHub project, navigate to Settings > Webhooks.
Click Add webhook.
Add the following URL in the Payload URL field:
https://. Don’t forget to replace
<DATADOG_API_KEY> with your Datadog API Key.
application/json in the Content type dropdown menu.
Optionally, add a secret in the Secret field.
In the Which events would you like to trigger this webhook? section, click Let me select individual events. and select from the following supported options to send events to Datadog:
|Branch or tag creation|
|Pull request review comments|
|Security and analyses|
Select Active to receive event details when the hook is triggered.
Click Add webhook to save the webhook.
Add a webhook in Datadog
In the GitHub integration tile, navigate to the Webhooks tab.
Specify the repositories and branches you want to monitor for each repository. To add all repositories for a user or organization, use wildcards (
*). You can use wildcards on branch names. For example,
dev-* includes all branches starting with
To gather all events related to the
master branch of the
DataDog/documentation GitHub repository, you can enter
DataDog/documentation in the Repository field and
master in the Branches field.
If you wanted to gather all events related to all
master branches from the DataDog organization, enter
DataDog/* in the Repository field and
master in the Branches field.
Click the checkboxes for Commits and Issues to be alerted of these events.
Click Update Configuration to save the webhook configuration.
Once you have added webhooks in the Webhooks tab on the integration tile, events in the GitHub repositories you specified above start to appear in the Events Explorer. For more information, see the Events Explorer documentation.
To filter events coming from GitHub, select Github in the Source facet menu under Core, or enter
source:github in the search query. The bar chart of events automatically updates as you edit the search query.
The GitHub integration does not include any service checks.
Need help? Contact Datadog support.
Additional helpful documentation, links, and articles: