pub struct RequestRecord<'a> {Show 27 fields
pub message: Option<&'a str>,
pub context: LogContext<'a>,
pub session_address: Option<SocketAddr>,
pub backend_address: Option<SocketAddr>,
pub protocol: &'a str,
pub endpoint: EndpointRecord<'a>,
pub tags: Option<&'a CachedTags>,
pub client_rtt: Option<Duration>,
pub server_rtt: Option<Duration>,
pub user_agent: Option<&'a str>,
pub x_request_id: Option<&'a str>,
pub tls_version: Option<&'static str>,
pub tls_cipher: Option<&'static str>,
pub tls_sni: Option<&'a str>,
pub tls_alpn: Option<&'static str>,
pub xff_chain: Option<&'a str>,
pub service_time: Duration,
pub response_time: Option<Duration>,
pub request_time: Duration,
pub bytes_in: usize,
pub bytes_out: usize,
pub otel: Option<&'a OpenTelemetry>,
pub pid: i32,
pub tag: &'a str,
pub level: LogLevel,
pub now: Rfc3339Time,
pub precise_time: i128,
}Expand description
Intermediate representation of an access log agnostic of the final format. Every field is a reference to avoid capturing ownership (as a logger should).
Fields§
§message: Option<&'a str>§context: LogContext<'a>§session_address: Option<SocketAddr>§backend_address: Option<SocketAddr>§protocol: &'a str§endpoint: EndpointRecord<'a>§client_rtt: Option<Duration>§server_rtt: Option<Duration>§user_agent: Option<&'a str>§x_request_id: Option<&'a str>Value of the x-request-id header forwarded to the backend. Preserved
verbatim when the client supplied one; otherwise derived from the
request ULID (context.request_id). Used by downstream observability
pipelines as a universal correlation key.
tls_version: Option<&'static str>Negotiated TLS protocol version short-form (e.g. "TLSv1.3").
Static-string borrow plumbed straight from rustls. None for
plaintext listeners or when the version label is unknown.
tls_cipher: Option<&'static str>Negotiated TLS cipher suite short-form (e.g.
"TLS_AES_128_GCM_SHA256"). Static-string borrow plumbed straight
from rustls. None for plaintext listeners or when the cipher
label is unknown.
tls_sni: Option<&'a str>TLS Server Name Indication sent by the client at handshake (already
pre-lowercased, no port). None for plaintext listeners or when the
client omitted the SNI extension.
tls_alpn: Option<&'static str>Negotiated ALPN protocol (e.g. "h2", "http/1.1"). None for
plaintext listeners or when no ALPN was negotiated.
xff_chain: Option<&'a str>Verbatim value of the client-supplied X-Forwarded-For header as
observed before Sōzu appended its own hop. None if the request had
no X-Forwarded-For header.
service_time: Duration§response_time: Option<Duration>time from connecting to the backend until the end of the response
request_time: Durationtime between first byte of the request and last byte of the response
bytes_in: usize§bytes_out: usize§otel: Option<&'a OpenTelemetry>§pid: i32§tag: &'a str§level: LogLevel§now: Rfc3339Time§precise_time: i128Implementations§
Source§impl RequestRecord<'_>
impl RequestRecord<'_>
Sourcepub fn into_binary_access_log(self) -> ManuallyDrop<ProtobufAccessLog>
pub fn into_binary_access_log(self) -> ManuallyDrop<ProtobufAccessLog>
Converts the RequestRecord in its protobuf representation. Prost needs ownership over all the fields but we don’t want to take it from the user or clone them, so we use the unsafe DuplicateOwnership.