Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(settings): specify VALID_RETENTION_DAYS for self-hosted #6756

Merged

Conversation

aldy505
Copy link
Contributor

@aldy505 aldy505 commented Jan 12, 2025

Fixes getsentry/self-hosted#3421

I saw from the rust_snuba code, that we have this:

let mut retention_days = value.unwrap_or(config.default_retention_days);
if !config.valid_retention_days.contains(&retention_days) {
if retention_days <= config.lower_retention_days {
retention_days = config.lower_retention_days;
} else {
retention_days = config.default_retention_days;
}
}
retention_days

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.

LOWER_RETENTION_DAYS = 30

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.

@BYK
Copy link
Member

BYK commented Jan 12, 2025

/gcbrun

Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move the fetching of env vars into settings/__init__.py? I don't think there's a reason to expose those env vars for self-hosted only.

@aldy505
Copy link
Contributor Author

aldy505 commented Jan 14, 2025

can we move the fetching of env vars into settings/__init__.py? I don't think there's a reason to expose those env vars for self-hosted only.

@untitaker Will it break your production servers? If you don't need to change anything on your prod configs, then I'll do that.

@aldy505
Copy link
Contributor Author

aldy505 commented Jan 14, 2025

Also, can we merge this before the next release window (which is tomorrow)?

@untitaker
Copy link
Member

let's just keep it for now as that seems to be an established pattern.

@untitaker untitaker merged commit 5458741 into getsentry:master Jan 14, 2025
31 of 32 checks passed
@aldy505 aldy505 deleted the fix/settings/specify-valid-retention-days branch January 14, 2025 22:11
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.

ClickHouse Retention Not Honoring SENTRY_EVENT_RETENTION_DAYS Setting
3 participants