Repository navigation
Closed
Description
A user with rate limiting problems sent us an extract of their Relay log, and it seems there is no reason being tracked:
2023-03-01T08:41:52Z [relay_server::actors::outcome_aggregator] TRACE: Outcome aggregation requested:
TrackOutcome { timestamp: 2023-03-01T08:41:52.837099513Z, scoping: Scoping { organization_id: ...,
project_id: ProjectId(...), project_key: ProjectKey("..."), key_id:
Some(...) }, outcome: RateLimited(None), event_id: Some(EventId(...),
remote_addr: Some(127.0.0.1), category: Error, quantity: 1 }
This also shows in the stats_v2 API endpoint:
{
"by": {
"outcome": "rate_limited",
"reason": "none"
},
"totals": {
"sum(quantity)": 552830
}
}Is reason code "none" a valid one? If not, figure out how it was created.
- In Sentry, we never seem to generate a quota object without a reason code (double check).
- The only place in the Relay code base where we construct a
RateLimitedvariant with reasonNoneis when the envelope is empty (see below). Is this an expected code path? Why would we emit outcomes for an empty envelope for which the contents were already rate limited?
relay/relay-server/src/actors/project.rs
Lines 748 to 750 in ee8d51d
| let envelope = if envelope.is_empty() { | |
| // Individual rate limits have already been issued above | |
| envelope_context.reject(Outcome::RateLimited(None)); |
Config of the external Relay:
relay:
mode: managed
upstream: "https://sentry.io/"
host: 0.0.0.0
port: 8080
logging:
level: trace
format: auto
sentry:
enabled: true
dsn: "..."
http:
timeout: 65
connection_timeout: 65
limits:
max_concurrent_requests: 10000
max_connection_rate: 10000
max_session_count: 10000Internal issue: https://getsentry.atlassian.net/browse/FEEDBACK-1775.
Metadata
Metadata
Assignees
Labels
No labels
Activity
jjbayer commentedon Mar 17, 2023
Update:
This was now also reported for a customer without any external Relay, starting Feb 23 at 18:00 UTC. Did we deploy a change at that time?
There is a second place in the code where we produce
Noneas reason code:relay/relay-server/src/actors/processor.rs
Lines 2324 to 2326 in f202d15
jjbayer commentedon Mar 20, 2023
For external Relays, check if internal Relays drop the outcome reason in HTTP headers and external Relays log
Nonein their fast path.jjbayer commentedon Mar 21, 2023
Turns out this was
outcome: abuse, notoutcome: rate limited, so ignore.fix(quota): New reason code for fallback rate limit (#1967)