Why Connect GitHub?
Without GitHub integration, Guardian can only analyze runtime data (logs, traces, metrics, k8s resources, profiling). With GitHub connected, Guardian gains the ability to:Code Analysis
Examine actual source code to understand implementation details and identify bugs
Change Correlation
Correlate issues with recent deployments and code changes
Fix Suggestions
Provide specific code fixes and implementation recommendations
Documentation Context
Reference your code comments, READMEs, and documentation during investigations
Setting Up GitHub Integration
If you are onboarding Guardian for the first time, you can connect GitHub directly from the onboarding flow or you can connect it later from the Settings → Integrations page in Metoro1
Navigate to Guardian Onboarding Page
Go to Guardian Overview and click on to Guardian onboarding button at the bottom right of the page.
2
Connect GitHub
In the Guardian onboarding flow, you will see a step to connect GitHub, click on Connect GitHub Account button.
- If you are already connected, you can skip this step
3
Authorize in GitHub
You’ll be redirected to GitHub to authorize the Metoro app:
- Select your organization or personal account
- Choose repository access:
- All repositories - Recommended for full coverage
- Selected repositories - Choose specific repos to grant access
- Review requested permissions
- Click Install & Authorize After authorization, you’ll be redirected back to Metoro with GitHub successfully connected.
4
Link Repositories
After GitHub is connected, you need to map your services to their corresponding GitHub repositories.
This can be done in the Link Repositories step in the onboarding flow or later in the Service Catalog -> Select your service -> Link Source Code button at the top right of the page Service Dashboard page.
Required Permissions: The Metoro GitHub App requiresRead access to:
- Repository contents (code, branches, commits)
- Repository metadata
- Pull requests
- Issues
Step 2: Verify Connection
After installation, verify the connection:- Return to Settings → Integrations → GitHub
- You should see:
- ✅ GitHub Connected
Repository Mapping
Repository mapping links your Metoro services to their corresponding GitHub repositories, enabling Guardian to analyze the right code for each service.Understanding Service-to-Repository Mapping
Each service in your system needs to be mapped to its source code repository:- One-to-One: Single service maps to single repository (most common)
- Monorepo: Multiple services map to same repository with different paths
Step 1: Access Repository Mapping
- Navigate to Guardian → Guardian Onboarding → Link Repositories
- You’ll see a list of all detected services in your system with the option to map each service to a repository.
Step 2: Map Services to Repositories
For each service, configure its repository mapping:- Simple Mapping
- Monorepo Mapping
Standard Repository MappingFor services with dedicated repositories:
- Find your service in the list (e.g.,
payment-service
) - Click Map Repository
- Select the repository from dropdown (e.g.,
org/payment-service
) - Leave Repository Path empty (uses root)
- Click Save Mapping
- Service:
payment-service
- Repository:
metoro-org/payment-service
- Path:
/
(root)
Advanced Configuration
Branch Selection
Configure which branch Guardian should analyze:- Default Branch
- Specific Branch
- Environment-Based
Guardian uses the repository’s default branch (usually
main
or master
)No configuration needed - this is the default behaviorValidation Checklist
Run through this checklist to ensure proper setup:- GitHub App installed and authorized
- Repositories accessible in Metoro
- All production services mapped to repositories
- Monorepo paths correctly configured
- Mappings validated successfully
- Test investigation completed successfully
FAQ
Can Guardian modify my code?
Can Guardian modify my code?
Guardian can create PRs but it won’t merge them automatically. You must review and merge any PRs created by Guardian.
What if my repository structure changes?
What if my repository structure changes?
Update the repository mappings when you restructure code. Guardian will use the new paths immediately.
How does Guardian handle private repositories?
How does Guardian handle private repositories?
The GitHub App authorization grants access to selected private repositories. Guardian respects all GitHub permissions.