-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): Expose rate limits for metrics (#3347)
Adds a new rate limit component to quota limits in the `x-sentry-rate-limits` header that communicates the namespace(s) that a metrics rate limit should apply to. The data category of limits that have this component is always `metric_bucket`, in other quotas this component will not be set. Clients will receive rate limit entries in the response of every envelope that contains a metric item, regardless of whether the contents match the specific namespace. This is a performance optimization so Relay can avoid to parse item contents in the fast path while the request is still open. Limitations: - As soon as a single metric rate limit is active, _all_ envelope requests containing a metrics item will result in a 429 status code. It is the client's responsibility to parse the header and ignore irrelevant rate limits. - These rate limits are not propagated on the batch metrics endpoint. External Relays do not use this endpoint and send envelopes instead, so backoff will work as expected. However, if external Relays would start to use that endpoint, additional changes would be necessary as they also do not receive quotas.
- Loading branch information
Showing
14 changed files
with
501 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.