RiftRelay is configured entirely through environment variables. All variables are optional except forDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/renja-g/RiftRelay/llms.txt
Use this file to discover all available pages before exploring further.
RIOT_TOKEN.
Required
Your Riot Games API token(s). Multiple tokens can be provided as a comma-separated list for load balancing.
Whitespace around tokens is automatically trimmed. Each token is validated during startup.
Server Configuration
The port number on which RiftRelay listens for incoming HTTP requests.Validation: Must be between 1 and 65535
Maximum duration for reading request headers.
Maximum duration for reading the entire request, including the body.
Maximum duration before timing out writes of the response.
Maximum duration to wait for the next request when keep-alives are enabled.
Maximum duration to wait for graceful shutdown before forcefully terminating.
During graceful shutdown, RiftRelay stops accepting new requests and waits for in-flight requests to complete.
Queue and Admission Control
Maximum number of requests that can be queued while waiting for rate limit availability.Validation: Must be >= 1
Maximum duration a request can wait in the queue before timing out.Validation: Must be >= 0
Additional time buffer added to rate limit windows to prevent premature bucket expiration.Validation: Must be >= 0
This helps account for clock skew and network latency between RiftRelay and Riot’s servers.
Rate Limiting
Default application-level rate limits when not specified in Riot API response headers. Format is
limit:window pairs separated by commas.Format: requests:seconds,requests:secondsValidation: Each limit and window must be positive integersThis is a fallback only. RiftRelay primarily uses rate limits from Riot’s
X-App-Rate-Limit and X-Method-Rate-Limit headers.Upstream Transport
Configuration for the HTTP client used to communicate with Riot’s API servers.Overall timeout for upstream requests to Riot API. A value of 0 means no timeout.Validation: Must be >= 0
Maximum number of idle connections across all hosts.Validation: Must be >= 1
Maximum number of idle connections to keep per host.Validation: Must be >= 1
Maximum number of total connections per host. A value of 0 means no limit.Validation: Must be >= 0
Maximum duration an idle connection will remain open before being closed.Validation: Must be >= 0
Maximum duration to wait for a TLS handshake to complete.Validation: Must be >= 0
Maximum duration to wait for a server’s first response headers after sending request headers with
Expect: 100-continue.Validation: Must be >= 0Maximum duration to wait for a dial to complete.Validation: Must be >= 0
Interval between keep-alive probes for an active network connection.Validation: Must be >= 0
Maximum duration to wait for a server’s response headers after fully writing the request.Validation: Must be >= 0
Whether to force HTTP/2 for upstream connections when available.
Features
Enable Prometheus metrics endpoint at
/metrics.When enabled, metrics include request counts, latencies, queue depths, and rate limit bucket states.
Enable pprof profiling endpoints at
/debug/pprof/*.Enable Swagger UI documentation at
/swagger/*.Duration Format
All duration values use Go’s duration format:ns- nanosecondsusorµs- microsecondsms- millisecondss- secondsm- minutesh- hours
500ms, 2s, 5m, 1h30m
Example .env file
Example .env file
Validation Rules
Configuration is validated at startup. RiftRelay will fail to start and print all validation errors if any configuration values are invalid.
- Integers: Must be valid integer values within their specified ranges
- Durations: Must use valid Go duration format (e.g.,
150ms,2s,5m) - Booleans: Accepts
true,false,1,0,t,f,T,F(case-insensitive) - Rate Limits: Must follow
limit:window,limit:windowformat with positive integers - PORT: Must be between 1 and 65535