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

ClickHouse Retention Not Honoring SENTRY_EVENT_RETENTION_DAYS Setting #3421

Open
honoam opened this issue Nov 9, 2024 · 1 comment
Open

Comments

@honoam
Copy link

honoam commented Nov 9, 2024

Self-Hosted Version

24.7.1

CPU Architecture

x86_64

Docker Version

27.1.1

Docker Compose Version

2.29.1

Steps to Reproduce

hi
I'm using Sentry v24.7.1 self-hosted, with ClickHouse as the storage backend for events. I’ve configured the environment variable SENTRY_EVENT_RETENTION_DAYS=7 in my .env file, expecting events to be deleted after 7 days. However, when I check the ClickHouse tables, I still see data that is 30 days old, indicating that the retention setting is not being respected.
these are 4 most size tables inside of clickhouse

table──────────────────────────────────────────────┬─size───────┐
│ spans_local                                        │ 12.62 GiB  │
│ generic_metric_distributions_aggregated_local      │ 5.62 GiB   │
│ generic_metric_distributions_raw_local             │ 3.57 GiB   │
│ transactions_local                                 │ 1.16 GiB   │
│ query_views_log                                    │ 154.69 MiB │
│ generic_metric_sets_local                          │ 137.31 MiB │

and these are latest records inside spans_local

┌─retention_days─┬─────start_timestamp─┬────start_timestamp_precise─┬─start_ms─┬───────end_timestamp─┬──────end_timestamp_precise─┬─end_ms─┬─duration─┐
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.208719 │      208 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.209528 │    208 │        0 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.201476 │      201 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.202353 │    201 │        0 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.206322 │      206 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.207173 │    206 │        0 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.197592 │      197 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.198417 │    197 │        0 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.213196 │      213 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.214833 │    214 │        1 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.452439 │      452 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.454118 │    453 │        1 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.084820 │       84 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.086433 │     85 │        1 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.495588 │      495 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.501052 │    500 │        5 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.170826 │      170 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.172795 │    171 │        1 │
│             30 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.026508 │       26 │ 2024-11-09 12:42:35 │ 2024-11-09 12:42:35.028064 │     27 │        1 │
└────────────────┴─────────────────────┴────────────────────────────┴──────────┴─────────────────────┴────────────────────────────┴────────┴──────────┘

all of them have 30 days retention why? i tried to install it new multiple times but it didn't work.

if you could give me solution for cleanup of Clickhouse really appreciated it

Thanks in advance for any guidance!

Expected Result

clickhouse keeps data for 7 days

Actual Result

clickhouse keeps data for 30 days

Event ID

No response

@bc-sentry
Copy link

Did you restart the snuba container after changing the setting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: No status
Development

No branches or pull requests

3 participants