Skip to content

ref(profiles): Apply continuous profiling rate limits to transaction profiles#5614

Open
Dav1dde wants to merge 1 commit intomasterfrom
dav1d/rate-limit-profile-stuff-for-real
Open

ref(profiles): Apply continuous profiling rate limits to transaction profiles#5614
Dav1dde wants to merge 1 commit intomasterfrom
dav1d/rate-limit-profile-stuff-for-real

Conversation

@Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Feb 4, 2026

Implements: RELAY-199

Does not implement the fast path rate limiting, only "slow" path. This is practically useless since we cannot determine the category correctly in the fast path and would introduce a lot of additional complexity to track the platform separately.

@Dav1dde Dav1dde requested a review from a team as a code owner February 4, 2026 15:45
@Dav1dde Dav1dde changed the base branch from master to dav1d/profile-rate-limits February 4, 2026 15:45
@Dav1dde Dav1dde changed the title Dav1d/rate limit profile stuff for real ref(profiles): Apply continuous profiling rate limits to transaction profiles Feb 4, 2026
@Dav1dde Dav1dde requested a review from phacops February 4, 2026 15:46
@Dav1dde Dav1dde force-pushed the dav1d/rate-limit-profile-stuff-for-real branch 2 times, most recently from f48d71d to 6280c8e Compare February 4, 2026 15:48
@Dav1dde Dav1dde requested a review from Zylphrex February 4, 2026 15:50
@linear
Copy link

linear bot commented Feb 4, 2026

Base automatically changed from dav1d/profile-rate-limits to master February 5, 2026 09:12
…profiles

Context:

Transaction profiles have largely been replaced with continuous profiling.
Customers (AM3) are now billed by continuous profiling hours.
Transaction profiles are in the end just considered a profile chunk.

In Relay we have 3 (well 4) data categories:

- PROFILE/ PROFILE_INDEXED - Transaction profiles
- PROFILE_CHUNK - Backend profile chunks
- PROFILE_CHUNK_UI - Frontend/UI profile chunks

To make it easier, there are also PROFILE_CHUNK{,_UI}_HOUR categories,
but we can ignore them for now.

The problem now arises with plans which pay for backend or frontend continuous profiling
and they run out quota for one of the categories. We should also stop accepting
transaction profiles, if their respective backend/frontend data categories is limited.

The Bug:

The getsentry billing backend also added the PROFILE data category into the limit: 0
quota (when customers run out of billing quota), when either backend or ui continuous
profiling was exhausted.

This means, transaction profiles from backend were dropped when the customer
ran out of quota for continuous ui profiling.

A solution:

Now there are many possible solutions, from introducing more data categories to … other things.
They all have a similar problem, they break how our rate limiting is propagated and enforced,
as determining the continuous profiling category requires parsing the platform from the transaction body.

New data categories have the problem they have possibly unintended side effects like outcome
reasons showing up in the wrong data categories. This is also the reason why we can only
modify the rate limiting code, not count transaction profiles to a continuous profiling
category consistently (e.g. when implementing Counted).

The least bad solution seems to be to only change the rate limiting code for transaction profiles
to conditionally also consider the continuous profiling category, if it is available
(e.g. only in "slow path" or if platform is embedded into the item header).
@Dav1dde Dav1dde force-pushed the dav1d/rate-limit-profile-stuff-for-real branch from 6280c8e to 8a8f4f2 Compare February 5, 2026 15:45
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.

2 participants