Skip to main content

report_upstream_error

Function report_upstream_error 

Source
pub fn report_upstream_error(
    provider: &str,
    operation_id: &str,
    upstream_status: u16,
    proxy_status: u16,
    error_type: Option<&str>,
    error_message: Option<&str>,
)
Expand description

Attach structured tags + class-based dynamic title to the current Sentry scope and emit a tracing event at the appropriate level for the upstream status class.

Buckets (event title literal):

  • auth_error → 401, 403, 407 (Error)
  • bad_input → 400, 404 (non-no-records), 422 (Error)
  • quota → 402 (Warning; dropped by before_send)
  • rate_limited → 429 (Warning; dropped by before_send)
  • server_error → 5xx (Error)
  • transport_error → 0 / unknown (Error)

Each title is a distinct literal so sentry-tracing creates a separate Sentry issue per class. The (provider, operation_id, status) live as tags so each bucket stays per-provider searchable without splitting into one bucket per provider.

When the sentry feature is off, emits the tracing event only.