Skip to main content

RequestRecord

Struct RequestRecord 

Source
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>§tags: Option<&'a CachedTags>§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: Duration

time 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: i128

Implementations§

Source§

impl RequestRecord<'_>

Source

pub fn full_tags(&self) -> FullTags<'_>

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for RequestRecord<'a>

§

impl<'a> RefUnwindSafe for RequestRecord<'a>

§

impl<'a> Send for RequestRecord<'a>

§

impl<'a> Sync for RequestRecord<'a>

§

impl<'a> Unpin for RequestRecord<'a>

§

impl<'a> UnsafeUnpin for RequestRecord<'a>

§

impl<'a> UnwindSafe for RequestRecord<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V