Skip to content
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

**Internal**:

- Set the default log retention to 30 days for full fidelity and downsampled data. ([#5065](https://github.com/getsentry/relay/pull/5065))
- Improved PII Scrubbing for attributes / logs ([#5061](https://github.com/getsentry/relay/pull/5061)))

## 25.8.0
Expand Down
1 change: 1 addition & 0 deletions relay-server/src/processing/logs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ impl Forward for LogOutput {
let ctx = store::Context {
scoping,
received_at,
// Hard-code retentions until we have a per data category retention
retention: retentions.0,
downsampled_retention: retentions.1,
};
Expand Down
8 changes: 5 additions & 3 deletions relay-server/src/processing/logs/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ pub fn expand(logs: Managed<SerializedLogs>, _ctx: Context<'_>) -> Managed<Expan

ExpandedLogs {
headers: logs.headers,
logs: all_logs,
// Hard code both retentions for logs launch until we have separate retentions for
// different data categories.
#[cfg(feature = "processing")]
retention: _ctx.project_info.config.event_retention,
Copy link
Member

Choose a reason for hiding this comment

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

Now the function no longer needs _ctx as an argument.

retention: Some(30),
#[cfg(feature = "processing")]
downsampled_retention: _ctx.project_info.config.downsampled_event_retention,
logs: all_logs,
downsampled_retention: Some(30),
Copy link

Choose a reason for hiding this comment

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

Bug: Log Retention Mismatch

Logs are currently assigned a downsampled_retention of Some(30). This contradicts the stated intention that logs should not have downsampled retention yet, implying it should be None.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

We can just remove downsampled_retention and retention alltogether from the ExpandedLogs struct now and then have the retentions as a const somewhere in logs/store.rs.

}
})
}
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_ourlogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_ourlog_extraction_with_otel_logs(
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down Expand Up @@ -312,7 +312,7 @@ def test_ourlog_extraction_with_sentry_logs(
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down Expand Up @@ -354,7 +354,7 @@ def test_ourlog_extraction_with_sentry_logs(
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down Expand Up @@ -628,7 +628,7 @@ def test_ourlog_extraction_default_pii_scrubbing_does_not_scrub_default_attribut
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down Expand Up @@ -685,7 +685,7 @@ def test_ourlog_extraction_with_sentry_logs_with_missing_fields(
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down Expand Up @@ -813,7 +813,7 @@ def test_browser_name_version_extraction(
"organizationId": "1",
"projectId": "42",
"received": time_within_delta(),
"retentionDays": 90,
"retentionDays": 30,
"serverSampleRate": 1.0,
"timestamp": time_within_delta(
ts, delta=timedelta(seconds=1), expect_resolution="ns"
Expand Down
Loading