pub struct HttpRequest {
Show 15 fields pub request_method: String, pub request_url: String, pub request_size: i64, pub status: i32, pub response_size: i64, pub user_agent: String, pub remote_ip: String, pub server_ip: String, pub referer: String, pub latency: Option<Duration>, pub cache_lookup: bool, pub cache_hit: bool, pub cache_validated_with_origin_server: bool, pub cache_fill_bytes: i64, pub protocol: String,
}
Expand description

A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.

Fields

request_method: String

The request method. Examples: "GET", "HEAD", "PUT", "POST".

request_url: String

The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: "<http://example.com/some/info?color=red".>

request_size: i64

The size of the HTTP request message in bytes, including the request headers and the request body.

status: i32

The response code indicating the status of response. Examples: 200, 404.

response_size: i64

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

user_agent: String

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

remote_ip: String

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

server_ip: String

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

referer: String

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

latency: Option<Duration>

The request processing latency on the server, from the time the request was received until the response was sent.

cache_lookup: bool

Whether or not a cache lookup was attempted.

cache_hit: bool

Whether or not an entity was served from cache (with or without validation).

cache_validated_with_origin_server: bool

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

cache_fill_bytes: i64

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

protocol: String

Protocol used for the request. Examples: “HTTP/1.1”, “HTTP/2”, “websocket”

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

Encodes the message to a buffer. Read more

Encodes the message to a newly allocated buffer.

Encodes the message with a length-delimiter to a buffer. Read more

Encodes the message with a length-delimiter to a newly allocated buffer.

Decodes an instance of the message from a buffer. Read more

Decodes a length-delimited instance of the message from the buffer.

Decodes an instance of the message from a buffer, and merges it into self. Read more

Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more