GitHub
Integrate Monte Carlo with GitHub to see how code changes affect your data and AI agents.
Using GitHub Enterprise Server?GitHub Enterprise Server (GHES) has a different setup process. See the GHES specific documentation.
Overview
With the GitHub integration, you can:
| Capability | Available via |
|---|---|
| See relevant PRs on incident charts to speed up resolution | Pull requests |
| See recent PRs on table asset pages | Asset page (requires dbt integration) |
| Have Bayes, Monte Carlo's AI Teammate, diagnose and fix issues in your AI agents using their code | Reinforcement Loop |
| Have Bayes review PRs and block risky data changes before production | MC Prevent (PR Agent and CI Agent) |
After installing the GitHub Integration, turn on what you need. See Capabilities.
The Monte Carlo GitHub App cannot push commits, create branches, or merge pull requests. It can't bypass branch protection rules, required approvals, or required status checks.
Setup
Permissions required:
- Read access to administration and metadata
- Read and write access to issues and pull requests
- Read and write access to repository checks
- Read-only access to repository contents
Write access is only used to post pull request comments and check runs, and only on repos you turn this on for. Installing the app doesn't post anything. It can't push code or merge pull requests. If you enable draft PRs from Reinforcement Loop fixes, your own workflow opens them.
To connect GitHub:
- In Monte Carlo, go to Settings → Integrations and click Add.
- Under Code Repositories, select GitHub.
- In GitHub, select the organization, and optionally limit access to specific repositories.
- Click Install and Authorize. You'll be redirected back to Monte Carlo.
If you're not a GitHub organization owner, GitHub sends an approval request to the owner. The integration appears once they approve. Repeat for each organization.
dbt integrations (optional)
A dbt integration isn't required, but connecting one lets Monte Carlo map code changes to your dbt models and assets. Pull request history on asset pages and the PR Agent's validation notebooks require it. See dbt integration setup.
dbt Cloud
Setup is automatic. On data collector versions before v14050, configure the remote location manually (see dbt Core).
dbt Core
Provide the remote location of each dbt project:
- Go to Settings → Integrations → GitHub → (your org) → Edit connection.
- Open the Configure dbt Projects tab.
- For each dbt project, enter:
| Field | Value |
|---|---|
| GitHub project remote URL | e.g. https://github.com/org/repo |
| Project subdirectory | Only if the dbt project is in a subdirectory (e.g. analytics) |
You can also use the GraphQL API:
mutation updateDbtProjectInfo($uuid: UUID!, $remoteUrl: String, $subdirectory: String) {
updateDbtProjectInfo(uuid: $uuid, remoteUrl: $remoteUrl, subdirectory: $subdirectory) {
project {
uuid
}
}
}| Parameter | Description |
|---|---|
uuid | dbt project UUID |
remoteUrl | e.g. [email protected]:monte-carlo-data/dbt.git |
subdirectory | Root directory of the dbt project in the repo (e.g. analytics). Leave empty if it's at the root. |
Remote URL format: https://github.com/<org>/<repo> or git://github.com/<org>/<repo>.git.
Subdirectory: for analytics/models/foo/bar.sql, use analytics. For models/foo/bar.sql, leave it empty.
Next steps
Viewing pull requests on incidents and assets in Monte Carlo work as soon as the app is installed. Follow the steps below for additional capabilities:
| To use | Do this |
|---|---|
| Reinforcement Loop | Add a repo in your agent's Reinforcement Loop tab → Settings |
| PR Agent | Add repos to the PR Agent allowlist |
| CI Agent | Add the CI step to your pipeline |
To check that pull requests are coming through, look for merged pull requests on incident charts after your next merges.
Troubleshooting
| Symptom | Fix |
|---|---|
| Integration doesn't appear | Ask your GitHub org owner to approve the request |
| Pull requests never appear on charts | Add Monte Carlo's IPs (Account → Account Information → Networking) to your GitHub IP allowlist |
Limitations
- MC only collects PRs that merged after the integration setup time. Historical PRs are not available.
- Schema change monitors do not display GitHub pull requests.
- Pull request history on the asset page requires a dbt integration.
- Organizations using IP allowlists must add Monte Carlo's SaaS public IP address (see Account Information).
FAQ
Q: I just set up the integration. Why don't I see pull requests showing up yet?
MC only collects PRs that merged after the integration setup time. It does not have access to historical PRs, so it may take a few hours or days for PRs to start appearing depending on how frequently your team merges.
Q: Why can't I see pull requests for schema change alerts?
Schema change monitors don't use machine learning or the GitHub integration. They compare table schema hour-over-hour and identify differences, so they will not show GitHub pull requests.
Q: Why can't I see pull requests in the asset summary page?
A dbt integration is required to see pull request history on the asset page.
Q: My PRs are not showing up in Monte Carlo and my GitHub organization uses an IP allowlist. Do I need to allowlist any Monte Carlo IPs?
Yes. Add Monte Carlo's SaaS public IP address to your GitHub organization's IP allowlist. You can find the IP address on the Account Information page.
Updated about 2 hours ago
