pub struct DispatchInfo {Show 20 fields
pub method: String,
pub method_type: &'static str,
pub server_id: String,
pub protocol: String,
pub protocol_hash: String,
pub protocol_version: String,
pub request_id: String,
pub transport_metadata: Arc<Metadata>,
pub principal: String,
pub auth_domain: String,
pub authenticated: bool,
pub remote_addr: String,
pub http_status: u16,
pub request_data: Vec<u8>,
pub stream_id: String,
pub cancelled: bool,
pub claims: BTreeMap<String, String>,
pub request_bytes: Option<u64>,
pub externalized_bytes: u64,
pub access_sink: Option<AccessSink>,
}Expand description
Information passed to a dispatch hook at start and end of each call.
Default exists so a hook test (or a transport that only fills a few
fields) can use struct-update syntax and not be broken by a field added
later; the defaults are inert, not meaningful.
Fields§
§method: String§method_type: &'static str§server_id: String§protocol: StringLogical service / protocol name.
protocol_hash: StringSHA-256 hex of the canonical describe payload (always required in access log).
protocol_version: StringOperator-supplied free-form protocol-contract version label (optional).
request_id: String§transport_metadata: Arc<Metadata>Transport-level metadata (HTTP peer addr / pipe contextvar payload).
principal: StringAuthenticated principal name, empty when anonymous.
auth_domain: StringAuthentication domain identifier, empty when anonymous.
authenticated: boolTrue when the call was authenticated.
remote_addr: StringHTTP transport: remote IP:port. Empty otherwise.
http_status: u16HTTP transport: response status; 0 when not applicable.
request_data: Vec<u8>Self-contained Arrow IPC stream of the request batch (unary + stream init only).
stream_id: StringStream lifecycle identifier (32-char lowercase hex); empty on unary.
cancelled: boolTrue when a stream was cancelled by the client.
claims: BTreeMap<String, String>Authentication claims — e.g. decoded JWT claims, X.509 cert
extensions, OAuth introspection fields. Cloned from
AuthContext::claims at
dispatch start. Used by the Sentry hook to enrich user / tag
fields per Python 2d93987.
request_bytes: Option<u64>On-wire size of the request body as received, before
decompression — what the peer actually sent. None on transports
with no discrete request body (pipe / unix / tcp), where the framing
is a continuous IPC stream rather than a message with a length.
Distinct from CallStatistics::input_bytes, which counts logical
Arrow buffers after decoding and is routinely orders of magnitude
larger. One figure is what egress is billed on, the other what the
worker had to process.
externalized_bytes: u64Bytes uploaded to external storage during this call. Externalised payloads leave only a pointer batch on the wire, so transport-level accounting cannot see them at all — and they are frequently the largest of the three byte figures.
access_sink: Option<AccessSink>Where a hook parks a record it cannot finish yet. None means emit
inline. See AccessSink.
Implementations§
Source§impl DispatchInfo
impl DispatchInfo
Sourcepub fn from_request(
server: &RpcServer,
req: &Request,
method_type: &'static str,
auth: &AuthContext,
) -> Self
pub fn from_request( server: &RpcServer, req: &Request, method_type: &'static str, auth: &AuthContext, ) -> Self
Build a DispatchInfo from the serving server + request + resolved
auth context. method_type is either "unary" or "stream".
Trait Implementations§
Source§impl Clone for DispatchInfo
impl Clone for DispatchInfo
Source§fn clone(&self) -> DispatchInfo
fn clone(&self) -> DispatchInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more