Skip to content

CG-12173: Add Sentry Integration with ViewSentryTool#856

Draft
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/91c58f89-9138-4c5f-807d-5669ede34f37
Draft

CG-12173: Add Sentry Integration with ViewSentryTool#856
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/91c58f89-9138-4c5f-807d-5669ede34f37

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 15, 2025

Description

This PR adds a Sentry integration to Codegen, implementing the ViewSentryTool as requested. The integration allows users to view Sentry issues and events directly from Codegen.

Features

  • Sentry API Client: Implemented a client for interacting with the Sentry API
  • ViewSentryTool: Created a tool for viewing Sentry issues and events
  • LangChain Integration: Added LangChain tools for the Sentry integration
  • Configuration Module: Added configuration handling for Sentry credentials
  • Example Notebook: Created an example notebook demonstrating the usage of the Sentry integration
  • Documentation: Added comprehensive documentation for the Sentry integration

Implementation Details

The implementation follows the existing patterns in the codebase:

  1. Sentry API Client (src/codegen/extensions/sentry/sentry_client.py):

    • Handles authentication and communication with the Sentry API
    • Provides methods for fetching organizations, projects, issues, and events
    • Includes Pydantic models for structured data
  2. Configuration Module (src/codegen/extensions/sentry/config.py):

    • Manages Sentry API credentials and configuration
    • Provides helper functions for getting auth tokens and installation UUIDs
  3. Tool Implementation (src/codegen/extensions/tools/sentry/tools.py):

    • Implements the core functionality for viewing Sentry issues and events
    • Includes observation classes for structured responses
    • Provides comprehensive error handling
  4. LangChain Integration (src/codegen/extensions/langchain/sentry_tools.py):

    • Implements LangChain tools for the Sentry integration
    • Includes a combined tool for all Sentry operations
    • Provides input validation and error handling
  5. Example Notebook (src/codegen/extensions/sentry/example.ipynb):

    • Demonstrates how to use the Sentry integration
    • Includes examples of direct usage and using LangChain tools
  6. Documentation (src/codegen/extensions/sentry/README.md):

    • Provides comprehensive documentation for the Sentry integration
    • Includes setup instructions, usage examples, and API reference

Environment Variables

The following environment variables need to be set:

  • SENTRY_AUTH_TOKEN: Your Sentry auth token
  • SENTRY_CODEGEN_INSTALLATION_UUID: The installation UUID for the Codegen Sentry account
  • SENTRY_RAMP_INSTALLATION_UUID: The installation UUID for the Ramp Sentry account (if applicable)

Testing

The implementation has been tested with the example notebook and works as expected.

Next Steps

  • Add unit tests for the Sentry integration
  • Add more features like creating issues, updating issues, etc.
  • Add support for more Sentry API endpoints

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


codegen-bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant