getsentry / getsentry/sentry

Project Data Retention Time Settings

Open
#76,826 5 comments 1 reaction 0 assignees View on GitHub
Feature Product Area: Settings - Projects
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
22h 21m
Merged PRs (30d)
586

Description

### Problem Statement

In Sentry, the following configuration can control the data retention days for all projects.

```
SENTRY_OPTIONS["system.event-retention-days"] = int(
env("SENTRY_EVENT_RETENTION_DAYS", "60")
)
```
In Snuba, the following configuration can override the retention settings in Sentry.

```
ENFORCE_RETENTION: bool = False
LOWER_RETENTION_DAYS = 30
DEFAULT_RETENTION_DAYS = 90
VALID_RETENTION_DAYS = set([30, 90])
```
However, these configurations cannot set different data retention times for different projects. In real business scenarios, the data retention requirements vary for different projects. For example, Java and Go backend services can have shorter data retention periods, but APM data for the Android platform requires at least six months of retention. Currently, this cannot be achieved.

### Solution Brainstorm

Add a retention time configuration in the Project Settings page of Sentry. If the retention time is configured in the Project Settings page, it will take precedence; otherwise, the default retention time will be applied.

![Image](https://github.com/user-attachments/assets/d9fe4b31-7ac2-48f7-8fed-afe6bfc0915f)

### Product Area

Settings - Projects

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.