Skip to content

Commit

Permalink
fix(settings): specify VALID_RETENTION_DAYS for self-hosted (#6756)
Browse files Browse the repository at this point in the history
Fixes getsentry/self-hosted#3421

I saw from the rust_snuba code, that we have this:
https://github.com/getsentry/snuba/blob/acfbe9a31880ecfe15888386bf40a2afe2b16088/rust_snuba/src/processors/utils.rs#L10-L20

But if we follow the default value, it will always defaults to `30`.
Whereas not everyone on the self-hosted instance uses value greater than
30. My own instance is set to 14.

https://github.com/getsentry/snuba/blob/acfbe9a31880ecfe15888386bf40a2afe2b16088/snuba/settings/__init__.py#L251

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
aldy505 authored Jan 14, 2025
1 parent c03b384 commit 5458741
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snuba/settings/settings_self_hosted.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@
DEBUG = env("DEBUG", "0").lower() in ("1", "true")

DEFAULT_RETENTION_DAYS = int(env("SENTRY_EVENT_RETENTION_DAYS", 90))
VALID_RETENTION_DAYS = set([int(env("SENTRY_EVENT_RETENTION_DAYS", 90)), 30, 60])
LOWER_RETENTION_DAYS = min(DEFAULT_RETENTION_DAYS, 30)

REDIS_HOST = env("REDIS_HOST", "127.0.0.1")
REDIS_PORT = int(env("REDIS_PORT", 6379))

0 comments on commit 5458741

Please sign in to comment.