Skip to content
Fluxer API

Gateway control

Gateway control is the Admin view of the running main Gateway cluster. It reads live node state and submits guild reload requests, and it exposes no session, presence, or call payload.

Fluxer answers every operation on this page with one RPC call to the main Gateway. A call that goes unanswered returns 504 GATEWAY_TIMEOUT. An overloaded cluster, or one with no responder, returns 503 SERVICE_UNAVAILABLE. A reply that cannot be interpreted returns 502 BAD_GATEWAY.

One snapshot of the Gateway cluster, taken across the nodes the request polled. Every top-level counter except uptime_seconds, node_count, and status is a plain sum over those nodes, including each member of memory. The nodes array reports each polled node on its own.

FieldTypeDescription
status1stringThe aggregate health of the cluster
sessionsintegerThe connected client Gateway sessions, summed across nodes
guildsintegerThe live guild processes, summed across nodes
presencesintegerThe tracked presences, summed across nodes
callsintegerThe live calls, summed across nodes
memorynode memory objectThe memory accounting, summed across nodes
process_countintegerThe Erlang processes in use, summed across nodes
process_limitintegerThe Erlang process ceiling, summed across nodes
uptime_seconds2integerThe lowest uptime any polled node reported, in seconds
node_count3integerThe number of nodes the request polled
nodes4array[gateway node object]The per-node breakdown (max 1000 entries)

1 healthy when every polled node reported healthy and degraded when at least one did not

2 The value tracks the most recently started node and drops back whenever any node restarts

3 Includes nodes that did not answer

4 Entries are ordered by node_id ascending. The node that served the request is always polled, so the array is never empty

{
"status": "healthy",
"sessions": 4820,
"guilds": 1913,
"presences": 4611,
"calls": 12,
"memory": {"total": "3221225472", "processes": "1610612736", "system": "1610612736"},
"process_count": 92114,
"process_limit": 2097152,
"uptime_seconds": 84213,
"node_count": 2,
"nodes": []
}

One entry for each node the request polled, including nodes that did not answer within the 10 second per-node deadline.

FieldTypeDescription
node_id1stringThe name the node reports for itself
status2stringThe health this node reported
sessionsintegerThe connected client Gateway sessions on this node
guildsintegerThe live guild processes on this node
presencesintegerThe tracked presences on this node
callsintegerThe live calls on this node
memorynode memory objectThe memory accounting for this node
process_countintegerThe Erlang processes in use on this node
process_limitintegerThe Erlang process ceiling on this node
uptime_secondsintegerThe seconds since this node started

1 A node reports its HOSTNAME environment value when that value is a non-blank string, and its Erlang node name otherwise

2 healthy for a node that answered and unavailable for one that did not. A node that did not answer reports null in place of every counter here and contributes zero to every cluster total

A node entry can have further diagnostic members. A client treats a member it does not recognise as absent.

Byte counts for one node, or for every polled node summed together. Every value is a decimal string because a JSON number cannot preserve a 64-bit byte count.

FieldTypeDescription
totalstringThe total bytes allocated
processesstringThe bytes allocated to Erlang processes
systemstringThe bytes allocated outside Erlang processes

One entry for each live guild process the read sampled. Every value except nsfw_level is read from the guild process itself.

FieldTypeDescription
node_idstringThe node that owns the guild process
guild_id?snowflakeThe ID of the guild the process serves, or null when the process state has no guild ID
guild_name1stringThe guild name the process holds in memory
guild_icon?stringThe icon hash the guild process holds in memory, or null when it has none
nsfw_level2?integerThe NSFW level resolved from stored guild data, or null when the guild could not be resolved
memory3stringThe bytes the guild process occupies, as a decimal string
member_countintegerThe number of members the guild process holds
session_countintegerThe number of sessions subscribed to the guild process
presence_countintegerThe number of presences the guild process tracks

1 A process whose cached guild data has no name reports Unknown

2 Null for a live process whose guild row could not be loaded and for a process that reports no guild_id

3 The Erlang process memory of the guild process. Entries are ordered by it descending across the whole cluster, with ties broken by guild_id ascending

Cluster voice state totals, with one grouping by voice region and one by voice server.

FieldTypeDescription
total_voice_states1integerThe voice states across the whole cluster
regions2array[region voice state count object]The counts grouped by voice region (max 1000 entries)
servers2array[server voice state count object]The counts grouped by voice server (max 5000 entries)

1 The sum of the totals each node reported, so it can differ from the sum of the entries in regions or servers

2 Entries are ordered by voice_state_count descending, with ties broken by identifier ascending. An identifier with no voice states is absent from the array, so every entry has a count of at least 1

{
"total_voice_states": 318,
"regions": [{"region_id": "europe-north", "voice_state_count": 204}],
"servers": [{"server_id": "europe-north-server-1", "voice_state_count": 204}]
}

One entry for each voice region that holds at least one voice state.

FieldTypeDescription
region_idstringThe ID of the region the count belongs to
voice_state_countintegerThe voice states attributed to the region

One entry for each voice server that holds at least one voice state.

FieldTypeDescription
server_id1stringThe ID of the server the count belongs to
voice_state_countintegerThe voice states attributed to the server

1 The identifier is unique only inside its region

GET/v1/admin/gateway/stats

Returns the node statistics object for the whole Gateway cluster. Requires gateway:memory_stats.

StatusBodyCondition
200node statistics objectCluster state was returned

200 requests per minute for each authenticated user, on the admin:lookup bucket.

GET/v1/admin/gateway/memory-stats

Returns the heaviest live guild processes as guild memory statistics objects. Requires gateway:memory_stats.

FieldTypeDescription
limit?1integerThe maximum guild processes to return (100-1000, default 100)

1 The Gateway clamps the value it acts on to 500, and each node contributes at most 100 of its own guild processes. A limit of 1000 returns at most 500 entries

FieldTypeDescription
guildsarray[guild memory statistics object]The guild processes in this response (max 1000 entries)
StatusBodyCondition
200response bodyThe guild processes were returned

A node that does not answer within 5 seconds contributes no entries, and the request still returns 200.

200 requests per minute for each authenticated user, on the admin:lookup bucket.

GET/v1/admin/gateway/voice-state-counts

Returns the voice state count object, grouped by voice region and by voice server. Requires gateway:memory_stats.

StatusBodyCondition
200voice state count objectCounts were returned

The counts cover voice states in guild channels and in calls. A node that does not answer within 10 seconds contributes zero, and the request still returns 200.

200 requests per minute for each authenticated user, on the admin:lookup bucket.

POST/v1/admin/gateway/reloads

Rebuilds server-side state for the supplied guilds from the database and returns how many live guild processes were selected. Requires gateway:reload_all.

FieldTypeDescription
guild_ids1array[snowflake]The guilds to reload (max 1000 entries)

1 The field is required. An empty array selects every live guild process on every active node

FieldTypeDescription
count1 2integerThe number of live guild processes selected for reload

1 A supplied guild with no live process is skipped, so the value can be lower than the number of IDs sent. An owner node that fails or does not answer within 15 seconds contributes zero

2 Taken when the processes are selected. A selected process whose guild data cannot be fetched is still counted, so the value is an upper bound on the reloads that succeeded

StatusBodyCondition
200response bodyEvery selected guild process was dispatched

Each node reloads its selection in batches of ten with a 100 millisecond delay between batches. A guild whose owner node cannot be resolved is not counted. The response returns once the last batch has been dispatched, so an individual reload can still be in progress when the caller receives it. No guild data is changed and no Admin audit entry is recorded.

5 requests per minute for each authenticated user, on the admin:gateway:reload bucket.