Skip to content

External Relay reports rate limit without reason code #1929

Closed

Description

@jjbayer

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 RateLimited variant with reason None is 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?

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: 10000

Internal issue: https://getsentry.atlassian.net/browse/FEEDBACK-1775.

Activity

  1. jjbayer commented on Mar 17, 2023

    @jjbayer
    MemberAuthor

    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?

    Image

    There is a second place in the code where we produce None as reason code:

    if !has_metrics {
    // Individual rate limits have already been issued
    state.envelope_context.reject(Outcome::RateLimited(None));

  2. jjbayer commented on Mar 20, 2023

    @jjbayer
    MemberAuthor

    For external Relays, check if internal Relays drop the outcome reason in HTTP headers and external Relays log None in their fast path.

  3. self-assigned this
    on Mar 20, 2023
  4. jjbayer commented on Mar 21, 2023

    @jjbayer
    MemberAuthor

    This was now also reported for a customer without any external Relay.

    Turns out this was outcome: abuse, not outcome: rate limited, so ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions