RESTTelemetryEvent
RESTTelemetryEvent = {
durationMs:number;method:string;route:string;status:number;type:"response"; } | {attempts:number;durationMs:number;method:string;ok:boolean;route:string;status:number;type:"request"; } | {retryAfterMs:number;route:string;scope:"user"|"global"|"shared"|"unknown";type:"rateLimited"; } | {durationMs:number;reason:"bucket"|"global"|"probe";type:"wait"; } | {granted:boolean;known:boolean;latencyMs:number;type:"reservation"; } | {attempt:number;reason:"rateLimited"|"server"|"network";route:string;type:"retry"; } | {stage:"queued"|"waiting"|"transport"|"retry";type:"cancelled"; } | {type:"overloaded"; } | {type:"tokenRejected"; } | {timedOut:boolean;type:"networkError"; } | {change:"discovered"|"remapped";route:string;type:"bucket"; } | {latencyMs:number;ok:boolean;operation:string;type:"store"; } | {mode:CoordinationMode;previous:CoordinationMode;type:"mode"; } | {inFlight:number;queued:number;type:"queue"; }
Defined in: packages/rest/src/telemetry.ts:6
What the REST pipeline reports while it works. Every field is bounded and
free of secrets: routes are normalized (ids become :id, tokens :token,
reaction emoji :emoji), and no token, fingerprint or body is included.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ durationMs: number; method: string; route: string; status: number; type: "response"; }
One HTTP attempt got a response.
Type Literal
Section titled “Type Literal”{ attempts: number; durationMs: number; method: string; ok: boolean; route: string; status: number; type: "request"; }
A request settled (after every attempt), successfully or not.
Type Literal
Section titled “Type Literal”{ retryAfterMs: number; route: string; scope: "user" | "global" | "shared" | "unknown"; type: "rateLimited"; }
Discord answered 429.
Type Literal
Section titled “Type Literal”{ durationMs: number; reason: "bucket" | "global" | "probe"; type: "wait"; }
A request waited for a limit before it could be sent.
Type Literal
Section titled “Type Literal”{ granted: boolean; known: boolean; latencyMs: number; type: "reservation"; }
A reservation was asked of the store.
Type Literal
Section titled “Type Literal”{ attempt: number; reason: "rateLimited" | "server" | "network"; route: string; type: "retry"; }
A request is being sent again.
Type Literal
Section titled “Type Literal”{ stage: "queued" | "waiting" | "transport" | "retry"; type: "cancelled"; }
A request was cancelled.
Type Literal
Section titled “Type Literal”{ type: "overloaded"; }
A request was refused because a queue was full.
Type Literal
Section titled “Type Literal”{ type: "tokenRejected"; }
Discord answered 401 on a bot route: later requests with the token are refused.
Type Literal
Section titled “Type Literal”{ timedOut: boolean; type: "networkError"; }
A transport attempt failed without a response.
Type Literal
Section titled “Type Literal”{ change: "discovered" | "remapped"; route: string; type: "bucket"; }
A route learned its bucket hash, or the hash changed.
Type Literal
Section titled “Type Literal”{ latencyMs: number; ok: boolean; operation: string; type: "store"; }
One store command (Redis), with its latency.
Type Literal
Section titled “Type Literal”{ mode: CoordinationMode; previous: CoordinationMode; type: "mode"; }
The store’s coordination mode changed.
Type Literal
Section titled “Type Literal”{ inFlight: number; queued: number; type: "queue"; }
Queue depth and in-flight requests, after a change.