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

Spans are double-counted in redis when quota is defined for span and span_indexed. #4259

Closed
jjbayer opened this issue Nov 18, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jjbayer
Copy link
Member

jjbayer commented Nov 18, 2024

A quota like

{
    "id": "foo",
    "categories": ["span", "span_indexed"]
}

increments the redis counter by 2 for each span. This has the effect that rate limits start dropping events earlier than they should.

This PR already contains a test to reproduce the behavior: #4258

@jjbayer
Copy link
Member Author

jjbayer commented Jan 28, 2025

For regular data categories, this behavior is a feature, not a bug (e.g. error abuse quota categories are defined as [DataCategory.DEFAULT, DataCategory.ERROR, DataCategory.SECURITY]. Only if two data categories represent the same thing does this become a problem, but it's hard to catch in current code.

I browsed sentry-side code and it does not seem like we currently define a suspicious quota as described above. For now, log an error in case quotas like this appear: #4476

@jjbayer
Copy link
Member Author

jjbayer commented Feb 3, 2025

The error introduced above does not appear, and we will get warned if it does.

@jjbayer jjbayer closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant