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

feat(server): Scrub transactions before enforcing quotas #3248

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Mar 11, 2024

We previously enforced quotas before PII scrubbing because rate limiting did not depend on having PII-scrubbed data.

Now that we want to rate limit spans that are extracted from transactions, which in turn depend on PII-scrubbing, we need to turn the order around.

Note that this should barely increase cost, because the vast majority of rate limited events is caught by cached rate limits on the fast path, not the consistent rate limiting step in the processor (which is mainly there for incrementing the redis counter).

jjbayer added a commit that referenced this pull request Mar 11, 2024
jjbayer added a commit that referenced this pull request Mar 12, 2024
Rate limit `Span` and `OtelSpan` items when a rate limit for either
`Span` or `SpanIndexed` data categories exist.

This PR does **not** yet rate limit

* span _metrics_, which I will implement in a separate PR.
* Quota enforcement on spans extracted from transactions (requires
#3248).

ref: #3079
@jjbayer jjbayer self-assigned this Mar 13, 2024
@jjbayer jjbayer changed the title feat(server): Scrub before enforcing quotas feat(server): Scrub transactions before enforcing quotas Mar 20, 2024
@jjbayer jjbayer marked this pull request as ready for review March 20, 2024 15:59
@jjbayer jjbayer requested a review from a team as a code owner March 20, 2024 15:59
Comment on lines +1161 to +1162
assert len(spans) == 0 # all rejected
assert summarize_outcomes() == {(16, 2): 2} # SpanIndexed, RateLimited
Copy link
Member Author

Choose a reason for hiding this comment

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

These assertions fail without the change in process_transactions.

@jjbayer jjbayer merged commit f58ac69 into master Mar 21, 2024
20 checks passed
@jjbayer jjbayer deleted the ref/server-late-enforce-quotas branch March 21, 2024 09:41
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