opentelemetry_stackdriver/proto/logging/
type.rs

1// This file is @generated by prost-build.
2/// A common proto for logging HTTP requests. Only contains semantics
3/// defined by the HTTP specification. Product-specific logging
4/// information MUST be defined in a separate message.
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct HttpRequest {
7    /// The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
8    #[prost(string, tag = "1")]
9    pub request_method: ::prost::alloc::string::String,
10    /// The scheme (http, https), the host name, the path and the query
11    /// portion of the URL that was requested.
12    /// Example: `"<http://example.com/some/info?color=red"`.>
13    #[prost(string, tag = "2")]
14    pub request_url: ::prost::alloc::string::String,
15    /// The size of the HTTP request message in bytes, including the request
16    /// headers and the request body.
17    #[prost(int64, tag = "3")]
18    pub request_size: i64,
19    /// The response code indicating the status of response.
20    /// Examples: 200, 404.
21    #[prost(int32, tag = "4")]
22    pub status: i32,
23    /// The size of the HTTP response message sent back to the client, in bytes,
24    /// including the response headers and the response body.
25    #[prost(int64, tag = "5")]
26    pub response_size: i64,
27    /// The user agent sent by the client. Example:
28    /// `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
29    /// CLR 1.0.3705)"`.
30    #[prost(string, tag = "6")]
31    pub user_agent: ::prost::alloc::string::String,
32    /// The IP address (IPv4 or IPv6) of the client that issued the HTTP
33    /// request. This field can include port information. Examples:
34    /// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
35    #[prost(string, tag = "7")]
36    pub remote_ip: ::prost::alloc::string::String,
37    /// The IP address (IPv4 or IPv6) of the origin server that the request was
38    /// sent to. This field can include port information. Examples:
39    /// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
40    #[prost(string, tag = "13")]
41    pub server_ip: ::prost::alloc::string::String,
42    /// The referer URL of the request, as defined in
43    /// [HTTP/1.1 Header Field
44    /// Definitions](<https://datatracker.ietf.org/doc/html/rfc2616#section-14.36>).
45    #[prost(string, tag = "8")]
46    pub referer: ::prost::alloc::string::String,
47    /// The request processing latency on the server, from the time the request was
48    /// received until the response was sent.
49    #[prost(message, optional, tag = "14")]
50    pub latency: ::core::option::Option<::prost_types::Duration>,
51    /// Whether or not a cache lookup was attempted.
52    #[prost(bool, tag = "11")]
53    pub cache_lookup: bool,
54    /// Whether or not an entity was served from cache
55    /// (with or without validation).
56    #[prost(bool, tag = "9")]
57    pub cache_hit: bool,
58    /// Whether or not the response was validated with the origin server before
59    /// being served from cache. This field is only meaningful if `cache_hit` is
60    /// True.
61    #[prost(bool, tag = "10")]
62    pub cache_validated_with_origin_server: bool,
63    /// The number of HTTP response bytes inserted into cache. Set only when a
64    /// cache fill was attempted.
65    #[prost(int64, tag = "12")]
66    pub cache_fill_bytes: i64,
67    /// Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
68    #[prost(string, tag = "15")]
69    pub protocol: ::prost::alloc::string::String,
70}
71/// The severity of the event described in a log entry, expressed as one of the
72/// standard severity levels listed below.  For your reference, the levels are
73/// assigned the listed numeric values. The effect of using numeric values other
74/// than those listed is undefined.
75///
76/// You can filter for log entries by severity.  For example, the following
77/// filter expression will match log entries with severities `INFO`, `NOTICE`,
78/// and `WARNING`:
79///
80///      severity > DEBUG AND severity <= WARNING
81///
82/// If you are writing log entries, you should map other severity encodings to
83/// one of these standard levels. For example, you might map all of Java's FINE,
84/// FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the
85/// original severity level in the log entry payload if you wish.
86#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
87#[repr(i32)]
88pub enum LogSeverity {
89    /// (0) The log entry has no assigned severity level.
90    Default = 0,
91    /// (100) Debug or trace information.
92    Debug = 100,
93    /// (200) Routine information, such as ongoing status or performance.
94    Info = 200,
95    /// (300) Normal but significant events, such as start up, shut down, or
96    /// a configuration change.
97    Notice = 300,
98    /// (400) Warning events might cause problems.
99    Warning = 400,
100    /// (500) Error events are likely to cause problems.
101    Error = 500,
102    /// (600) Critical events cause more severe problems or outages.
103    Critical = 600,
104    /// (700) A person must take an action immediately.
105    Alert = 700,
106    /// (800) One or more systems are unusable.
107    Emergency = 800,
108}
109impl LogSeverity {
110    /// String value of the enum field names used in the ProtoBuf definition.
111    ///
112    /// The values are not transformed in any way and thus are considered stable
113    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
114    pub fn as_str_name(&self) -> &'static str {
115        match self {
116            Self::Default => "DEFAULT",
117            Self::Debug => "DEBUG",
118            Self::Info => "INFO",
119            Self::Notice => "NOTICE",
120            Self::Warning => "WARNING",
121            Self::Error => "ERROR",
122            Self::Critical => "CRITICAL",
123            Self::Alert => "ALERT",
124            Self::Emergency => "EMERGENCY",
125        }
126    }
127    /// Creates an enum from field names used in the ProtoBuf definition.
128    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
129        match value {
130            "DEFAULT" => Some(Self::Default),
131            "DEBUG" => Some(Self::Debug),
132            "INFO" => Some(Self::Info),
133            "NOTICE" => Some(Self::Notice),
134            "WARNING" => Some(Self::Warning),
135            "ERROR" => Some(Self::Error),
136            "CRITICAL" => Some(Self::Critical),
137            "ALERT" => Some(Self::Alert),
138            "EMERGENCY" => Some(Self::Emergency),
139            _ => None,
140        }
141    }
142}