Skip to content

feat(billing): Add common retention policy types#368

Draft
dashed wants to merge 3 commits into
mainfrom
aleal/feat/retention-policy-types
Draft

feat(billing): Add common retention policy types#368
dashed wants to merge 3 commits into
mainfrom
aleal/feat/retention-policy-types

Conversation

@dashed

@dashed dashed commented Jul 17, 2026

Copy link
Copy Markdown
Member

Closes https://linear.app/getsentry/issue/REVENG-333/introduce-retention-protos

This introduces common and re-usable retention protos that'll be used in:

  • contract (customer specific retention overrides)
  • package (default retentions for a given pricing package)

Prior art from legacy billing system that's ported into new billing platform world:

Define bounded standard retention and optional downsampled retention with an explicit inherit-standard marker. Add Python presence tests and Rust generated-binding round trips.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 17, 2026, 9:06 PM

// message presence.
message StandardRetention {
// The number of calendar days that data is retained. Must be greater than zero.
uint32 days = 1;

@dashed dashed Jul 17, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

message InheritStandard {}

// The retention policy for a category's downsampled data.
message DownsampledRetention {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Explain full-fidelity and downsampled representations, absent versus inherited policy, and invalid protobuf default states for readers without prior retention context.
@dashed dashed self-assigned this Jul 17, 2026

// Retention for a distinct downsampled representation. Absence means that no
// such representation exists; it does not mean to inherit standard retention.
optional DownsampledRetention downsampled = 2;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note that, it is legal for a data category to have both standard and downsampled retention settings.

For example, spans have retention of 30 days, while its downsampled counter part can be stored up to 13 months on AM3 business plans: https://github.com/getsentry/getsentry/blob/ac0ba4af432a399b77b42227d4017eaa14be65e4/getsentry/billing/plans/am3/business.py#L173-L178

@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

REVENG-333

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.

1 participant