---
title: GitHub
description: >-
  GitHub is a web-based hosting service for software development projects that
  use the Git revision control system.
breadcrumbs: Docs > Integrations > GitHub
---

# GitHub
        GitHub Code Snippet in Datadog UIAutomated Comments in GitHub Pull RequestDatadog's Action Catalog for GitHubGitHub Overview Dashboard
## Overview{% #overview %}

The Datadog GitHub integration collects four main types of data:

- **Audit Records** - Enterprise-level security and compliance data tracking organization-wide activities, user access changes, and security settings through Audit Log Streaming.

- **Repository Events** - Real-time tracking of repository activities including pull requests, issues, commits, and branch changes through webhooks.

- **Source Code Information** - Gives access to source code to power bi-directional features between Datadog and GitHub such as displaying code snippets in APM traces, Error Tracking, and Security tools, or enabling automated PR comments from Code Security and Test Optimization.

- **Telemetry Data** - Automated collection of Code Scan Alerts, Secret Scan Alerts, and repository metrics to track security trends and workflow patterns.

#### GitHub Apps{% #github-apps %}

Datadog's GitHub Apps integration enables you to configure [GitHub Apps](https://docs.github.com/en/apps) that connect your GitHub organization or personal account to Datadog. This allows you to access source code-related functionality, collect valuable data, and help you monitor and secure your GitHub environment. Manage your GitHub Apps through the [Configuration tab](https://app.datadoghq.com/integrations/github/configuration) to get started.

**Source Code Functionality**: When installed with the correct permissions, the GitHub integration powers several different source code features across Datadog products to help you with troubleshooting and taking action on your code. Some examples include:

- Speed up investigations in Error Tracking, Continuous Profiler, and Code Security using in-line code snippets to contextualize where a problem is coming from in your code.
- Power up your code reviews with automated feedback and suggested changes directly on your pull requests from Code Security and Test Optimization.
- Take action on your codebase with custom automations built with Datadog Actions and Remediations.

For example, once the GitHub App is installed with the relevant permissions enabled, you can use the Datadog [source code integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md) to see code snippets in your stack traces, get automated feedback and suggested changes through pull request comments from [CI Visibility](https://docs.datadoghq.com/continuous_integration/guides/pull_request_comments.md) and [Code Security](https://docs.datadoghq.com/security/code_security/dev_tool_int/github_pull_requests.md), and access multiple service definitions in GitHub from the [Software Catalog](https://docs.datadoghq.com/service_catalog/adding_metadata.md#store-and-edit-definitions-in-github).



#### Repository Events{% #repository-events %}

Capture GitHub events in Datadog to:

- Track new features from code changes
- Identify when new code changes lead to system alerts or build failures
- Discuss code changes with your team
- Declare an incident or export an event to an ongoing incident

Consume Events related to your actions in specific repositories and/or branches including:

| Event Name                                                                                                                                      | Event Actions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Branch or tag creation](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#create)                            |
| [Branch or tag deletion](https://docs.github.com/en/webhooks/webhook-events-and-payloads#delete)                                                |
| [Branch protection rules](https://docs.github.com/en/webhooks/webhook-events-and-payloads#branch_protection_rule)                               | The following actions are supported:- [`created`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#branch_protection_rule)- [`deleted`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#branch_protection_rule)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#branch_protection_rule)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Commit comments](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#commit_comment)                           |
| [Dependabot alerts](https://docs.github.com/en/webhooks/webhook-events-and-payloads#dependabot_alert)                                           | The following actions are supported:- [`auto_dismissed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=auto_dismissed#dependabot_alert)- [`auto_reopened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=auto_reopened#dependabot_alert)- [`created`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#dependabot_alert)- [`dismissed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=dismissed#dependabot_alert)- [`fixed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=fixed#dependabot_alert)- [`reintroduced`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=reintroduced#dependabot_alert)- [`reopened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=reopened#dependabot_alert)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Issue comments](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment)                             | The following actions are supported:- [`created`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#issue_comment)- [`deleted`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#issue_comment)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#issue_comment)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Issues](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#issues)                                            | The following actions are supported:- [`assigned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=assigned#issues)- [`closed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=closed#issues)- [`deleted`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#issues)- [`demilestoned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=demilestoned#issues)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#issues)- [`labeled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=labeled#issues)- [`locked`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=locked#issues)- [`milestoned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=milestoned#issues)- [`opened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#issues)- [`pinned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=pinned#issues)- [`reopened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=reopened#issues)- [`transferred`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=transferred#issues)- [`unassigned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unassigned#issues)- [`unlabeled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unlabeled#issues)- [`unlocked`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unlocked#issues)- [`unpinned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unpinned#issues)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Pull request review comments](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review_comment) | The following actions are supported:- [`created`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#pull_request_review_comment)- [`deleted`](https://app.datadoghq.com/hhttps://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#pull_request_review_comment)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request_review_comment)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Pull requests](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request)                               | The following actions are supported:- [`assigned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=assigned#pull_request)- [`unassigned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unassigned#pull_request)- [`labeled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=labeled#pull_request)- [`unlabeled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unlabeled#pull_request)- [`opened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request)- [`closed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=closed#pull_request)- [`reopened`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=reopened#pull_request)- [`synchronize`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=synchronize#pull_request)- [`converted_to_draft`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=converted_to_draft#pull_request)- [`locked`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=locked#pull_request)- [`unlocked`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unlocked#pull_request)- [`enqueued`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=enqueued#pull_request)- [`dequeued`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=dequeued#pull_request)- [`milestoned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=milestoned#pull_request)- [`demilestoned`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=demilestoned#pull_request)- [`ready_for_review`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=ready_for_review#pull_request)- [`review_requested`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=review_requested#pull_request)- [`review_request_removed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=review_request_removed#pull_request)- [`auto_merge_enabled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=auto_merge_enabled#pull_request)- [`auto_merge_disabled`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=auto_merge_disabled#pull_request) |
| [Pushes](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#push)                                              |
| [Repositories](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#repository)                                  | The following actions are supported:- [`archived`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=archived#repository)- [`created`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=created#repository)- [`deleted`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#repository)- [`edited`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#repository)- [`privatized`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=privatized#repository)- [`publicized`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=publicized#repository)- [`renamed`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=renamed#repository)- [`transferred`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=transferred#repository)- [`unarchived`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=unarchived#repository)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Repository vulnerability alerts](https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_vulnerability_alert)               | The following actions are supported:- [`create`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=create#repository_vulnerability_alert)- [`dismiss`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=dismiss#repository_vulnerability_alert)- [`reopen`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=reopen#repository_vulnerability_alert)- [`resolve`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=resolve#repository_vulnerability_alert)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Security Advisory](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory)                      | The following actions are supported:- [`published`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=published#security_advisory)- [`updated`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=updated#security_advisory)- [`withdrawn`](https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=withdrawn#security_advisory)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Team adds](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#team_add)                                       |
| [Visibility changes](https://docs.github.com/en/webhooks/webhook-events-and-payloads#public)                                                    |

#### Telemetry Data{% #telemetry-data %}

Automated data collection through metrics and logs crawlers:

- Code Scan Alert metrics
- Secret Scan Alert metrics
- Repository metrics
- Alert state tracking
- Workflow trends

#### Audit Records{% #audit-records %}

Enterprise-level security and compliance data:

- Audit Log Streaming (recommended for new customers)
  - Real-time organization-wide activity monitoring
  - User access changes
  - Security setting modifications
  - Organization-level events
- Legacy Audit Log Crawler (available only for customers who have previously configured it)
  - Historical audit log data
  - Organization security events

**Note**: Datadog has transitioned to Audit Log Streaming as the preferred method for audit log collection. While code scan and security crawlers remain active parts of GitHub Telemetry, the legacy Audit Log Crawler is only available for customers who previously had it installed.

## Setup{% #setup %}

### Configuration{% #configuration %}

Each data type requires specific permissions and setup steps. See the setup section for each data type to configure each portion of the integration.

- Audit Logs
- GitHub Apps
- Metrics
- Repository Events

### GitHub Apps{% #github-apps-1 %}

{% alert level="info" %}
Depending on the product feature, additional setup beyond the creation of a GitHub App may be required to fully enable that feature. Creating a GitHub App to connect your account only grants the GitHub permissions that these features require as prerequisites. You do not incur additional charges for creating GitHub Apps, and no feature associated with a billable product is enabled by default, even if you grant the prerequisite permissions for those features.
{% /alert %}

#### Supported Instance Types{% #supported-instance-types %}

Installing Datadog GitHub Apps is supported for:

1. **Cloud Instances:** GitHub.com and GitHub Enterprise Cloud
1. **Managed Instances:** GitHub Enterprise Server and GitHub Enterprise Cloud with Data Residency

- Requires additional configuration (see step 6 below)

#### GitHub App Types{% #github-app-types %}

Datadog offers two types of GitHub Apps:

1. **Marketplace App:** Datadog's official GitHub App listed in [GitHub's app marketplace](https://github.com/marketplace/datadog). The Marketplace App is managed by Datadog directly, ensuring all necessary requirements are available post-installation for all Datadog features. The Marketplace App is the easiest and recommended way to onboard and can be installed from within Datadog or in GitHub directly.
1. **Custom Apps:** Every Datadog org also has the option to install custom apps to fine tune permissions as desired. Custom Apps are owned and managed by the GitHub account they are installed in, not by Datadog and thus permission updates must be performed by the owner. Custom Apps can only be installed through the Datadog UI.

**Note:** GitHub only allows Marketplace Apps to be installed on cloud instances of GitHub. Managed instances using **GitHub Enterprise Server** or **GitHub Enterprise Cloud with Data Residency** must use Custom Apps.

#### Steps{% #steps %}

Follow the instructions below to install the Datadog GitHub App on your account:

1. In the [GitHub integration tile](https://app.datadoghq.com/integrations/github/), navigate to the **Configuration** tab.

1. Click **Connect GitHub Account** to begin the GitHub App installation process.

1. Select your instance type: **GitHub.com** or **GitHub Enterprise Server**.

1. Select your app type:

   - For **GitHub.com**: By default, you can continue to install Datadog's Marketplace App. Follow the prompts in GitHub to choose whether to install the GitHub App for **All repositories** or **Only select repositories**, then click **Install & Authorize**. You can select a Custom App instead if you wish to fine tune permissions.
   - For **GitHub Enterprise Server**: You can only install a Custom App.
   - The remaining instructions in this list only apply to Custom Apps, as they require more configuration than the Marketplace App, which is managed by Datadog directly.

1. In **Configure App**, either select **Organization** and enter the name of your organization in GitHub, or select **Personal Account**.

1. For managed GitHub instances, enter the URL of your GitHub Enterprise Server instance (version 2.22 or above) or GitHub Enterprise Cloud with Data Residency. Make sure that Datadog servers can connect to your GitHub instance. Server IPs are available in the Webhooks section of [IP Ranges](https://docs.datadoghq.com/api/latest/ip-ranges.md).

1. Optionally, if you do not wish to use Datadog's recommended configuration, expand **Edit GitHub App permissions** to view and customize the GitHub permissions you want to grant to Datadog. The summary contains these sections:

   - **Datadog Features** lists the general and product-specific features in Datadog that require specific GitHub permissions. Expand each feature for details on functionality and requirements.

   - **GitHub Permissions** lists the related GitHub permissions. You can use the **Access Level** drop-downs to change the access allowed for specific aspects of your GitHub environment.

By default, Datadog selects the recommended permissions needed for all source code-related features. Changing the permissions will impact feature functionality. The **Datadog Features** section identifies any unavailable features and their missing requirements.


Click **Create App in GitHub**. If needed, you are prompted to authenticate into GitHub.In GitHub, enter a name for your GitHub App and click **Create GitHub App**.Choose whether to install the GitHub App for **All repositories** or **Only select repositories**, then click **Install & Authorize**.
You're returned to where you left off in Datadog once you finish installing the GitHub App. To enable inline code snippets in APM, consider [setting up Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md).

#### Update an existing GitHub App{% #update-an-existing-github-app %}

If an installed custom GitHub App doesn't have the required permissions or webhooks for a feature, Datadog indicates any missing requirements on the **Configuration** tab of the integration page. This alert also appears in other areas of Datadog where you can enable and use GitHub-powered features, such as Test Optimization.

To update your custom GitHub App with missing requirements from the integration page:

1. Click **Review Missing Requirements**.
1. Select your desired Datadog features. The list only includes features that are missing requirements.
1. As you select each feature, note the specific **Repository Permissions**, **Organization Permissions**, or **Webhooks** listed in the next step of the instructions.
1. Click **Go to GitHub App Settings**, and authenticate with GitHub.
1. In GitHub, update the necessary permissions and webhooks. Review the instructions in Datadog if necessary.
1. Make sure to click **Save changes** at the bottom of the page in GitHub.
1. Datadog will attempt to verify that you made the correct changes. Return to Datadog to confirm that the verification passed with a green check mark. If you only need to update webhooks, you can close the instructions and stop here.

***If you updated permissions***

1. Click **Accept New Permissions** to go back to GitHub to accept the permissions changes.

1. In GitHub, click **Review request** and accept the new permissions.

1. Datadog will attempt to verify your new permissions were successfully accepted. Return to Datadog to confirm that this verification passed with a green check mark, then close the instructions.

#### Notebooks{% #notebooks %}

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](https://app.datadoghq.com/notebook).

1. Navigate to **Notebooks** > **New Notebook**.
1. Add a **Text** cell and mention an issue or pull request on GitHub in the **Edit** field. For example: `https://github.com/project/repository/pull/#`.
1. Click **Done**. The GitHub icon appears next to your linked issue or pull request.
1. If needed, click **Connect to Preview** and **Authorize**.
1. Hover over the linked issue or pull request to see the description preview.



#### Connect GitHub Teams to Datadog Teams{% #connect-github-teams-to-datadog-teams %}

To link GitHub Teams to [Datadog Teams](https://docs.datadoghq.com/account_management/teams.md), your GitHub app must have the *Members Read* permission. On the [GitHub integration tile](https://app.datadoghq.com/integrations/github/), click **Review Missing Requirements** and select **Link GitHub Teams** to see how to update your GitHub app with the necessary permissions.

When your GitHub app has the *Members Read* permission, you can link your Datadog team to a GitHub team:

1. In Datadog, navigate to **Organization Settings** > **Teams**.
1. Select the Datadog team you want to link.
1. On the team page, click **Settings**.
1. Select **GitHub Connection**.
1. Select the GitHub team you want to link.

Connecting GitHub Teams to Datadog Teams enhances the following features:

- [Code Security](https://docs.datadoghq.com/security/code_security.md): Datadog can [automatically associate detected vulnerabilities with teams](https://docs.datadoghq.com/getting_started/code_security.md?tab=staticcodeanalysissast#link-results-to-teams)
- [Error Tracking](https://docs.datadoghq.com/error_tracking/explorer.md): Automate assigning issues to teams with [Issue Team Ownership](https://docs.datadoghq.com/error_tracking/issue_team_ownership.md)

### Audit Logs{% #audit-logs %}

**Requirement**: A GitHub Enterprise account is required to collect audit logs.

Audit logs encompass all activities and events across a GitHub organization. Follow the instructions on [setting up streaming to Datadog](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#setting-up-streaming-to-datadog) in GitHub's documentation to forward your audit logs to Datadog. For more information about audit logs, see GitHub's documentation for [audit log actions](https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization#audit-log-actions).

### Telemetry Data{% #telemetry-data-1 %}

1. Set up an app following the instructions in the GitHub Apps Section.
1. Select the respective permissions for read access upon the application's installation.
1. Navigate to the **Telemetry** tab on the Datadog tile.
1. Toggle **Code Scan Alert** and/or **Secret Scan Alerts**.

***To opt-out of Code Scan or Secret Scan metrics:***

1. Find the corresponding organization on the **Telemetry** tab on the integration tile.
1. Click the toggle for the respective sections.
1. Click **Update Account**.

### Repository Events{% #repository-events-1 %}

**Prerequisite**: You must be a Github Admin for your repository.

#### From GitHub{% #from-github %}

1. Click on the **Settings** page of your GitHub project.

1. Click **Webhooks** under the **Code, planning automation** section

1. Click **Add Webhook**.

1. Add the following URL in the **Payload URL** field: `https://  /intake/webhook/github?api_key=<DATADOG_API_KEY>`. Don't forget to replace `<DATADOG_API_KEY>` with [your Datadog API Key](https://app.datadoghq.com/organization-settings/api-keys). This can also be generated on the tile.

1. Select `application/json` in the **Content type** dropdown menu.

1. Optionally, add a secret in the **Secret** field.

1. Ensure the `Active` Checkbox is selected

1. Click "Add Webhook"



1. In the **Which events would you like to trigger this webhook?** section, click **Let me select individual events**. Select events from the following supported options to send [events](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads) to Datadog:

- branch or tag creation
- branch or tag deletion
- branch protection rules
- commit comments
- dependabot alerts
- issue comments
- membership **Only for Organizations*
- pull request review comments
- pull requests
- pushes
- repositories
- repository vulnerability alerts
- security advisory
- team adds
- visibility changes

**Note** If you select an event that's not listed above, Datadog will not receive it.

#### Configure the Github Events Integration{% #configure-the-github-events-integration %}

After setting up the webhook in GitHub, configure which repositories and events to monitor in Datadog. If you would like to collect **commits** and/or **issues** from a repository, select the checkbox next to the repository and branch fields.

1. Navigate to the [GitHub integration tile](https://app.datadoghq.com/integrations/github/) in Datadog.

1. Click the **Events** tab.

1. In the **Repository Configuration** section:

   - Enter the repository name(s) you want to monitor
   - Format: `organization/repository` (e.g., `Datadog/documentation`)
   - For multiple repositories:
     - Use wildcards: `Datadog/*` monitors all repositories in the Datadog organization
     - List specific repositories: `Datadog/documentation`, `Datadog/integrations-core`

1. In the **Branch Configuration** section:

   - Enter the branch names to monitor
   - Examples:
     - Single branch: `main`
     - Multiple branches: `main`, `develop`
     - Using wildcards: `feature/*` monitors all feature branches
     - Common pattern: `dev-*` monitors all development branches

1. In the **Event Types** section:

   - Select **Commits** to track code changes
   - Select **Issues** to monitor issue activity
   - Both can be selected for comprehensive monitoring

1. Click **Update Configuration** to save your settings.

After configuration, you can view your repository events in the [Events Explorer](https://app.datadoghq.com/event/explorer/):

- Filter events using `source:github`.
- Use the Source facet menu under Core to filter GitHub events.
- The event stream updates in real-time as new events occur.

**Note**: It may take a few minutes for events to start appearing after initial configuration.

### Data Collected{% #data-collected %}

Collect actionable data derived from GitHub Audit Logs, Code Scans, Secret Scans, and Repository Metrics. This telemetry data will enable your engineering teams to understand trends for security workflows and events. This integration also collects repository events.

- Visualize and track repository activity, audit events, and your overall Alert state.
- Set monitors on specific repositories to ensure all new code scan alerts are tracked by your team, and route these straight to Slack or Jira to take immediate action.
- Secure your GitHub organization against threats by using [Datadog Cloud SIEM](https://docs.datadoghq.com/continuous_integration/guides/pull_request_comments.md) to detect signals that could indicate suspicious activity.

To start ingesting this data, follow the instructions on the [Telemetry tab](https://docs.datadoghq.com/security/code_security/dev_tool_int/github_pull_requests.md) after installing the Datadog GitHub App.

### Metrics{% #metrics %}

This integration collects the following metrics:

- Code Scan Alerts - Collect metrics related to the various types of code scanning alerts and track their trends overtime.

- Secret Scan Alerts - Collect metrics as secret scan alerts are detected and monitor how they are resolved.

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.

### Service Checks{% #service-checks %}

The GitHub integration does not include any service checks.

### Events{% #events %}

This integration uses webhooks to collect repository events, which you can view in the [Events Explorer](https://app.datadoghq.com/event/explorer/).

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).

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

- [Focus on code that matters with source code previews in Continuous Profiler](https://www.datadoghq.com/blog/source-code-preview/)
- [Fix production bugs efficiently with Datadog Live Debugging](https://www.datadoghq.com/blog/live-debugging/)
- [Ship high-quality, secure code faster with Datadog Code Analysis](https://www.datadoghq.com/blog/datadog-code-analysis/)
- [Build Datadog workflows and apps in minutes with our AI assistant](https://www.datadoghq.com/blog/ai-assistant-workflows-apps/)
- [Monitor GitHub with Datadog Cloud SIEM](https://www.datadoghq.com/blog/monitor-github-datadog-cloud-siem/)
- [GitHub](https://docs.datadoghq.com/integrations/github.md)
