Documentation Index
Fetch the complete documentation index at: https://metoro.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Code fixes help your team move from root cause to a reviewable patch without leaving Metoro. When Guardian determines that a production problem or deployment regression is likely caused by application code, it can inspect the mapped source repository, propose a fix, and prepare a pull request for your team to review.Find the Faulty Code
Guardian uses telemetry, deployment context, logs, traces, and source code mappings to identify the code most likely related to the issue.
Generate a Patch
Guardian runs a coding subagent against a temporary repository workspace and produces a generated code diff.
Review Before Merge
Metoro can create a pull request from the generated diff, but your team reviews, approves, and merges it.
How Code Fixes Work
Guardian investigates an issue
Guardian starts from a production issue, firing alert, assisted debugging session, or deployment verification result. It gathers the relevant runtime evidence before deciding whether source code context is needed.
Guardian finds the matching source code
Metoro uses source code mappings to connect Kubernetes services to the repositories, paths, and branches that contain their code.
Guardian analyzes a temporary repository workspace
When a code fix is needed, Guardian launches a short-lived coding subagent. The subagent receives the Guardian task, relevant observability context, and the mapped repository contents.
Guardian saves a generated diff
If the subagent makes a change, Metoro computes the diff between the base branch and the temporary branch, then stores the generated diff with the related investigation or issue.
Supported Source Code Integration
GitHub is the currently supported source code repository integration for code fixes. Connect GitHub when you want Guardian to:- Read relevant repository contents during investigations
- Correlate deployment changes with production behavior
- Generate code diffs for likely application bugs
- Create pull requests for generated fixes
GitHub is the supported repository integration for code fixes today. If you disconnect GitHub or remove repository access from the GitHub App, Guardian can still investigate runtime telemetry, but it will not be able to inspect private repository contents or generate repository-specific code fixes.
Setting Up GitHub for Code Fixes During Onboarding
If you are onboarding AI SRE for the first time, you can connect GitHub directly from the onboarding flow. You can also connect it later from the Settings -> Integrations page in Metoro.Connect GitHub
In the onboarding flow, click Connect GitHub Account.If GitHub is already connected, you can skip this step and continue to source code mapping.
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
Verify the Connection
After installation, verify the connection:- Return to Settings -> Integrations -> Third-Party Integrations -> GitHub
- Confirm that GitHub is connected. (The button will turn to Disconnect when GitHub is connected)
Source Code Mapping
Source code mapping tells Guardian which repository belongs to each Kubernetes service. During the onboarding flow, Metoro includes a Source Code Mapping step. This feature checks the services running in your cluster and tries to match them to repositories that Metoro can see from your connected GitHub account. It can also match services to public GitHub repositories when enough repository information is available. You can review and adjust the suggested mappings before using them. For each service, a mapping can include:- Repository URL
- Optional repository path for monorepos
- Optional branch name for environment-specific code
Repository Mapping
Repository mapping links your Metoro services to their corresponding GitHub repositories, enabling Metoro to analyze the right code for each service. Each service in your system can be mapped to its source code repository:- One-to-one: A single service maps to a single repository.
- Monorepo: Multiple services map to the same repository with different paths.
Access Repository Mapping
- Navigate to AI SRE -> Onboarding -> Source Code Mapping
- Review the services detected in your cluster
- Accept, edit, or add mappings for each service
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, such as
payment-service - Click Map Repository
- Select the repository, such as
org/payment-service - Leave Repository Path empty to use the repository root
- Click Save Mapping
- Service:
payment-service - Repository:
metoro-org/payment-service - Path:
/
Advanced Configuration
Branch Selection
Configure which branch Metoro should analyze:- Default Branch
- Specific Branch
- Environment-Based
Metoro uses the repository’s default branch, usually
main or master.No configuration is needed for this behavior.Reviewing Generated Code Fixes
After Guardian generates a code fix, you can review and create a pull request from Guardian -> Code Fixes page. Take me thereWhat Metoro Can and Cannot Do
Metoro can:- Analyze mapped source code when a Guardian workflow needs repository context
- Generate a proposed code diff for a likely application issue
- Create a pull request when a user chooses to create one from the generated diff
- Link generated fixes back to the related investigation or issue
- Continuously read every repository
- Store a persistent mirror of your source code
- Automatically merge pull requests
- Modify repositories outside the permissions granted to the GitHub App
FAQ
Can Metoro modify my code?
Can Metoro modify my code?
Metoro can generate code diffs and create pull requests when a user chooses to create one. It does not merge pull requests automatically.
Do I need to map every service manually?
Do I need to map every service manually?
No. During onboarding, Source Code Mapping can suggest mappings by comparing services running in your cluster with repositories visible through your GitHub integration or public GitHub repositories. You can review and edit those suggestions.
What if my service is in a monorepo?
What if my service is in a monorepo?
Map the service to the repository and set the repository path for that service, such as
/services/api. Guardian uses that path to focus code analysis on the relevant part of the repository.What if my repository structure changes?
What if my repository structure changes?
Update the repository mappings when you restructure code. Metoro will use the updated repository, path, and branch information for future investigations and code fixes.
How does Metoro handle private repositories?
How does Metoro handle private repositories?
The GitHub App authorization grants access only to the private repositories you select. Metoro respects the repository access granted to the GitHub App.
Where can I read more about GitHub permissions?
Where can I read more about GitHub permissions?
See GitHub Integration for the detailed GitHub permissions, storage, source-code access, and cleanup model.
Next Steps
GitHub Integration
Review GitHub setup, permissions, and source-code handling details
Issues
Track production issues and related generated fixes
Deployment Verification
Verify deployments and catch regressions automatically
Assisted Debugging
Ask Guardian to investigate production behavior directly
