getsentry / getsentry/sentry

Feature Request: Enable Gitlab Repository Integration Configuration in Sentry via API (Admin Service Accounts)

Open
#93,828 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Improvement Metrics Product Area: Settings - Integrations
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 23m
Merged PRs (30d)
607

Description

Problem Statement
Description

The current method for configuring repositories in Sentry requires manual intervention by a user with Admin or higher privileges in Sentry and Owner or Maintainer access in the corresponding GitLab repositories. This reliance on manual configuration is cumbersome, especially in organizations that follow the principle of least privilege. To improve the efficiency, scalability, and automation of Sentry integrations, we propose enabling repository integration configuration via the Sentry API using admin credentials or service accounts.

Problem Statement

Currently, there is no way to programmatically configure repository integrations in Sentry. This limitation results in the following challenges:

  • Observability teams often lack direct Admin access to all repositories in GitLab or Sentry, adhering to the principle of least privilege.
  • Team members with the "Member" role in Sentry cannot configure repositories in their own projects.
  • The lack of automation support for repository integrations leads to repetitive manual tasks, increasing time-to-delivery for Sentry setup.

This also introduces a significant dependency on users with specific permissions.
For example:

  • An Observability team without Admin privileges cannot integrate GitLab repositories with Sentry.
  • Even if a GitLab repository service account with suitable credentials is used, it cannot meet all permissions requirements, and integrations fail (e.g., "403 Forbidden" or "400 Bad Request" errors).
  • The only current workaround is manual intervention by a user with proper permissions, which is neither scalable nor aligned with automation-first principles.
Proposed Solution
  • Extend Sentry's API to allow programmatic repository integration configuration using Admin accounts or service accounts.
  • Create API endpoints that support:
    • Adding repositories to Sentry projects.
    • Assigning proper repository roles to users in Sentry during the integration process.
  • Ensure API calls respect security policies and include proper validation and error handling to prevent misuse.
    This capability will enable contributions to Sentry's environment in a way that respects security and permissions while supporting automation and scalability for large organizations.
Expected Benefits
  1. Automation: Support for API-driven workflows will reduce the need for manual intervention, accelerating setup and configuration.
  2. Scalability: Large organizations with many repositories can easily integrate them without process bottlenecks caused by manual intervention.
  3. Alignment with DevOps Principles: Enhances collaboration and self-service, empowering teams to manage their repositories in Sentry without relying on admins.
  4. Reduced Dependencies: Minimize the need for users with specific privileges to complete repository setups.
Example Use Case

An Observability team wants to set up error monitoring for a GitLab repository across multiple Sentry projects. Using the proposed API capabilities:

  • The team’s service account could programmatically integrate the repository with required scopes.
  • Configuration will no longer depend on permissions of individual users, making it easier to scale setups for new projects or repositories automatically.
References

The current issue is documented in a [Sentry support conversation], where existing permissions and workflows were reviewed. Highlights include:

Solution Brainstorm

No response

Product Area

Settings - Integrations

We want to define a set of lightweight metrics that SDKs can automatically collect for e.g. framework, language or platform, focusing only on signals that do NOT overlap with Tracing. Ideally these metrics should give a quick sense of app or runtime health, … while deeper investigation will still rely on traces or profiles.

Examples**:**

  • Node.js runtime metrics (e.g., event loop delay, heap usage)
  • Prisma-related metrics in Next.js
  • Mobile CPU / memory usage to help surface potential ANRs or app hangs

Candidate Metrics (add more below)

(please also add ideas, questions or examples in comments)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Sentry’s Settings - Integrations area, the existing GitLab integration, and the related issue #85928. Clarify the API entry points and permission model needed for service-account configuration, including repository assignment and user roles. Done means the scope is agreed and the endpoints have validation, security checks, and documented error handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, python
Domain
api, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.