diff --git a/docs/docs.json b/docs/docs.json index 296a85d39..047f53cdd 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -35,6 +35,7 @@ "integrations/slack", "integrations/linear", "integrations/jira", + "integrations/sentry", "integrations/notion", "integrations/figma", "integrations/circleci", diff --git a/docs/integrations/sentry.mdx b/docs/integrations/sentry.mdx new file mode 100644 index 000000000..ca672cb72 --- /dev/null +++ b/docs/integrations/sentry.mdx @@ -0,0 +1,195 @@ +--- +title: "Sentry Integration" +sidebarTitle: "Sentry" +icon: "sentry" +--- + +import { COMMUNITY_SLACK_URL } from "/snippets/links.mdx"; + +Integrate Codegen with your Sentry workspace to allow agents to analyze errors, manage issues, and provide intelligent debugging assistance. + +{/* TODO: Add Sentry integration screenshot */} + + + + The Sentry integration is currently in beta. Please reach out in the community to have it enabled for your Codegen account. + + +## Overview + +The Sentry integration enables Codegen agents to: +- **Analyze Production Errors:** Get detailed insights into errors and exceptions happening in your applications +- **Root Cause Analysis:** Use AI-powered analysis to understand why errors are occurring +- **Issue Management:** Update issue status, assign issues, and add comments +- **Project Management:** Create and manage Sentry projects and teams +- **Release Tracking:** Monitor releases and their associated issues + +## Step-by-Step Setup Guide + +Follow these steps to successfully connect Codegen to your Sentry workspace: + +### 1. Enable Sentry Integration for Your Organization + +The Sentry integration uses the Model Context Protocol (MCP) to provide secure access to your Sentry data. Contact the Codegen team to enable this feature for your organization. + +### 2. Connect Your Sentry Account + +- Go to [Codegen's Sentry Integration page](https://codegen.com/integrations/sentry). +- Click **Connect Sentry Workspace** and complete the OAuth flow. +- Grant the necessary permissions for Codegen to access your Sentry data. + + + Make sure you have the appropriate permissions in your Sentry organization to authorize third-party applications. + + +### 3. Configure Permissions + +The Sentry integration requires the following OAuth scopes: +- `org:read` - Read organization information +- `project:write` - Create and manage projects +- `team:write` - Create and manage teams +- `event:write` - Access error events and issues + +### 4. Start Using Codegen with Sentry + +Once connected, you can: +- Ask Codegen to analyze specific Sentry issues by providing issue URLs +- Request error analysis and debugging suggestions +- Have Codegen manage issue status and assignments +- Get insights into error patterns and trends + +## Capabilities + +The Sentry integration provides comprehensive access to your Sentry workspace: + +### Error Analysis & Debugging +- **Issue Details:** Fetch comprehensive information about specific errors and exceptions +- **Stacktrace Analysis:** Get detailed stacktraces and error context +- **Root Cause Analysis:** AI-powered analysis to identify the underlying causes of issues +- **Error Patterns:** Identify recurring issues and patterns across your applications + +### Issue Management +- **Status Updates:** Change issue status (resolved, ignored, unresolved) +- **Assignment:** Assign issues to team members or teams +- **Comments:** Add comments and updates to issues +- **Bulk Operations:** Manage multiple issues efficiently + +### Project & Team Management +- **Project Creation:** Create new Sentry projects for your applications +- **Team Management:** Create and manage teams within your organization +- **DSN Management:** Create and manage Data Source Names (DSNs) for your projects + +### Monitoring & Insights +- **Release Tracking:** Monitor releases and their associated issues +- **Error Trends:** Analyze error frequency and patterns over time +- **Performance Insights:** Get insights into application performance issues + +## How Agents Use Sentry + +Agents leverage the Sentry integration to provide intelligent debugging assistance: + +### Error Investigation +``` +Human: "Can you analyze this Sentry issue: https://my-org.sentry.io/issues/PROJECT-123" + +Agent: I'll analyze that Sentry issue for you. Let me fetch the details and provide insights... +``` + +### Proactive Issue Management +- **Automatic Triage:** Agents can automatically categorize and prioritize issues +- **Status Updates:** Keep issue status current based on code changes and fixes +- **Team Notifications:** Notify relevant team members about critical issues + +### Code-Error Correlation +- **Link PRs to Issues:** Connect GitHub pull requests to related Sentry issues +- **Fix Validation:** Verify that code changes resolve reported issues +- **Regression Detection:** Identify when new code introduces previously resolved issues + +## Technical Implementation + +The Sentry integration is built using: + +### Model Context Protocol (MCP) +- **Secure Communication:** Uses MCP for secure, standardized communication with Sentry +- **Real-time Access:** Direct connection to Sentry's API through MCP server +- **OAuth Authentication:** Secure token-based authentication with automatic refresh + +### Backend Architecture +- **Token Management:** Automatic OAuth token refresh and management +- **Feature Flags:** Organization-level feature flag control +- **Error Handling:** Robust error handling and timeout management + +### Available Tools +When the integration is enabled, agents have access to Sentry-specific tools: +- `sentry_whoami` - Get current user information +- `sentry_find_organizations` - List accessible organizations +- `sentry_find_projects` - List projects in an organization +- `sentry_find_issues` - Search for issues with advanced filtering +- `sentry_get_issue_details` - Get comprehensive issue information +- `sentry_update_issue` - Update issue status and assignments +- `sentry_analyze_issue_with_seer` - AI-powered root cause analysis + +## Best Practices + +### For Development Teams +1. **Consistent Naming:** Use clear, descriptive names for projects and teams +2. **Regular Monitoring:** Set up agents to regularly check for new critical issues +3. **Integration Workflow:** Incorporate Sentry analysis into your PR review process + +### For Issue Management +1. **Automated Triage:** Let agents handle initial issue categorization +2. **Status Tracking:** Keep issue status updated as fixes are deployed +3. **Documentation:** Use agent-generated analysis to document complex issues + +### Security Considerations +1. **Token Security:** OAuth tokens are securely managed and automatically refreshed +2. **Scope Limitation:** Only request necessary permissions for your use case +3. **Access Control:** Use Sentry's built-in access controls to limit data exposure + +## Troubleshooting + +### Common Issues + +**Integration Not Available** +- Ensure the Sentry MCP integration is enabled for your organization +- Contact support if you don't see the integration option + +**Authentication Errors** +- Check that your OAuth token hasn't expired +- Verify you have the necessary permissions in your Sentry organization +- Try disconnecting and reconnecting the integration + +**Timeout Issues** +- The integration has built-in timeout handling for API calls +- Large organizations may experience longer response times + +### Getting Help + +If you encounter issues with the Sentry integration: +1. Check the [troubleshooting guide](/troubleshooting) +2. Join our community Slack for support +3. Contact the Codegen team for organization-specific issues + +## Example Usage + +Here are some common ways to use the Sentry integration: + +### Analyzing a Specific Issue +``` +@codegen Can you analyze this Sentry issue and suggest a fix? +https://my-org.sentry.io/issues/PROJECT-123 +``` + +### Bulk Issue Management +``` +@codegen Please review all unresolved issues in the backend project +and prioritize them by frequency and impact +``` + +### Release Monitoring +``` +@codegen Check if the latest release introduced any new errors +and create GitHub issues for any critical problems +``` + +The Sentry integration makes error monitoring and debugging more efficient by providing AI-powered analysis and automated issue management capabilities. diff --git a/uv.lock b/uv.lock index 198ee4bd9..9fe7a7fc6 100644 --- a/uv.lock +++ b/uv.lock @@ -430,7 +430,6 @@ dependencies = [ { name = "hatch-vcs" }, { name = "hatchling" }, { name = "humanize" }, - { name = "mcp", extra = ["cli"] }, { name = "packaging" }, { name = "psutil" }, { name = "pydantic" }, @@ -492,7 +491,6 @@ requires-dist = [ { name = "hatch-vcs", specifier = ">=0.4.0" }, { name = "hatchling", specifier = ">=1.25.0" }, { name = "humanize", specifier = ">=4.10.0" }, - { name = "mcp", extras = ["cli"], specifier = "==1.9.4" }, { name = "packaging", specifier = ">=24.2" }, { name = "psutil", specifier = ">=5.8.0" }, { name = "pydantic", specifier = ">=2.9.2" }, @@ -1591,12 +1589,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/97/fc/80e655c955137393c443842ffcc4feccab5b12fa7cb8de9ced90f90e6998/mcp-1.9.4-py3-none-any.whl", hash = "sha256:7fcf36b62936adb8e63f89346bccca1268eeca9bf6dfb562ee10b1dfbda9dac0", size = 130232, upload-time = "2025-06-12T08:20:28.551Z" }, ] -[package.optional-dependencies] -cli = [ - { name = "python-dotenv" }, - { name = "typer" }, -] - [[package]] name = "mdurl" version = "0.1.2" @@ -2548,20 +2540,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424, upload-time = "2024-11-01T16:43:55.817Z" }, ] -[[package]] -name = "rich-click" -version = "1.8.8" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "rich" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a6/7a/4b78c5997f2a799a8c5c07f3b2145bbcda40115c4d35c76fbadd418a3c89/rich_click-1.8.8.tar.gz", hash = "sha256:547c618dea916620af05d4a6456da797fbde904c97901f44d2f32f89d85d6c84", size = 39066, upload-time = "2025-03-09T23:20:31.174Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/fa/69/963f0bf44a654f6465bdb66fb5a91051b0d7af9f742b5bd7202607165036/rich_click-1.8.8-py3-none-any.whl", hash = "sha256:205aabd5a98e64ab2c105dee9e368be27480ba004c7dfa2accd0ed44f9f1550e", size = 35747, upload-time = "2025-03-09T23:20:29.831Z" }, -] - [[package]] name = "rpds-py" version = "0.25.0"