accesslog.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. syntax = "proto3";
  2. package envoy.data.accesslog.v3;
  3. import "envoy/config/core/v3/address.proto";
  4. import "envoy/config/core/v3/base.proto";
  5. import "google/protobuf/any.proto";
  6. import "google/protobuf/duration.proto";
  7. import "google/protobuf/timestamp.proto";
  8. import "google/protobuf/wrappers.proto";
  9. import "udpa/annotations/status.proto";
  10. import "udpa/annotations/versioning.proto";
  11. import "validate/validate.proto";
  12. option java_package = "io.envoyproxy.envoy.data.accesslog.v3";
  13. option java_outer_classname = "AccesslogProto";
  14. option java_multiple_files = true;
  15. option go_package = "github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3;accesslogv3";
  16. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  17. // [#protodoc-title: gRPC access logs]
  18. // Envoy access logs describe incoming interaction with Envoy over a fixed
  19. // period of time, and typically cover a single request/response exchange,
  20. // (e.g. HTTP), stream (e.g. over HTTP/gRPC), or proxied connection (e.g. TCP).
  21. // Access logs contain fields defined in protocol-specific protobuf messages.
  22. //
  23. // Except where explicitly declared otherwise, all fields describe
  24. // *downstream* interaction between Envoy and a connected client.
  25. // Fields describing *upstream* interaction will explicitly include ``upstream``
  26. // in their name.
  27. message TCPAccessLogEntry {
  28. option (udpa.annotations.versioning).previous_message_type =
  29. "envoy.data.accesslog.v2.TCPAccessLogEntry";
  30. // Common properties shared by all Envoy access logs.
  31. AccessLogCommon common_properties = 1;
  32. // Properties of the TCP connection.
  33. ConnectionProperties connection_properties = 2;
  34. }
  35. message HTTPAccessLogEntry {
  36. option (udpa.annotations.versioning).previous_message_type =
  37. "envoy.data.accesslog.v2.HTTPAccessLogEntry";
  38. // HTTP version
  39. enum HTTPVersion {
  40. PROTOCOL_UNSPECIFIED = 0;
  41. HTTP10 = 1;
  42. HTTP11 = 2;
  43. HTTP2 = 3;
  44. HTTP3 = 4;
  45. }
  46. // Common properties shared by all Envoy access logs.
  47. AccessLogCommon common_properties = 1;
  48. HTTPVersion protocol_version = 2;
  49. // Description of the incoming HTTP request.
  50. HTTPRequestProperties request = 3;
  51. // Description of the outgoing HTTP response.
  52. HTTPResponseProperties response = 4;
  53. }
  54. // Defines fields for a connection
  55. message ConnectionProperties {
  56. option (udpa.annotations.versioning).previous_message_type =
  57. "envoy.data.accesslog.v2.ConnectionProperties";
  58. // Number of bytes received from downstream.
  59. uint64 received_bytes = 1;
  60. // Number of bytes sent to downstream.
  61. uint64 sent_bytes = 2;
  62. }
  63. // Defines fields that are shared by all Envoy access logs.
  64. // [#next-free-field: 23]
  65. message AccessLogCommon {
  66. option (udpa.annotations.versioning).previous_message_type =
  67. "envoy.data.accesslog.v2.AccessLogCommon";
  68. // [#not-implemented-hide:]
  69. // This field indicates the rate at which this log entry was sampled.
  70. // Valid range is (0.0, 1.0].
  71. double sample_rate = 1 [(validate.rules).double = {lte: 1.0 gt: 0.0}];
  72. // This field is the remote/origin address on which the request from the user was received.
  73. // Note: This may not be the physical peer. E.g, if the remote address is inferred from for
  74. // example the x-forwarder-for header, proxy protocol, etc.
  75. config.core.v3.Address downstream_remote_address = 2;
  76. // This field is the local/destination address on which the request from the user was received.
  77. config.core.v3.Address downstream_local_address = 3;
  78. // If the connection is secure,S this field will contain TLS properties.
  79. TLSProperties tls_properties = 4;
  80. // The time that Envoy started servicing this request. This is effectively the time that the first
  81. // downstream byte is received.
  82. google.protobuf.Timestamp start_time = 5;
  83. // Interval between the first downstream byte received and the last
  84. // downstream byte received (i.e. time it takes to receive a request).
  85. google.protobuf.Duration time_to_last_rx_byte = 6;
  86. // Interval between the first downstream byte received and the first upstream byte sent. There may
  87. // by considerable delta between *time_to_last_rx_byte* and this value due to filters.
  88. // Additionally, the same caveats apply as documented in *time_to_last_downstream_tx_byte* about
  89. // not accounting for kernel socket buffer time, etc.
  90. google.protobuf.Duration time_to_first_upstream_tx_byte = 7;
  91. // Interval between the first downstream byte received and the last upstream byte sent. There may
  92. // by considerable delta between *time_to_last_rx_byte* and this value due to filters.
  93. // Additionally, the same caveats apply as documented in *time_to_last_downstream_tx_byte* about
  94. // not accounting for kernel socket buffer time, etc.
  95. google.protobuf.Duration time_to_last_upstream_tx_byte = 8;
  96. // Interval between the first downstream byte received and the first upstream
  97. // byte received (i.e. time it takes to start receiving a response).
  98. google.protobuf.Duration time_to_first_upstream_rx_byte = 9;
  99. // Interval between the first downstream byte received and the last upstream
  100. // byte received (i.e. time it takes to receive a complete response).
  101. google.protobuf.Duration time_to_last_upstream_rx_byte = 10;
  102. // Interval between the first downstream byte received and the first downstream byte sent.
  103. // There may be a considerable delta between the *time_to_first_upstream_rx_byte* and this field
  104. // due to filters. Additionally, the same caveats apply as documented in
  105. // *time_to_last_downstream_tx_byte* about not accounting for kernel socket buffer time, etc.
  106. google.protobuf.Duration time_to_first_downstream_tx_byte = 11;
  107. // Interval between the first downstream byte received and the last downstream byte sent.
  108. // Depending on protocol, buffering, windowing, filters, etc. there may be a considerable delta
  109. // between *time_to_last_upstream_rx_byte* and this field. Note also that this is an approximate
  110. // time. In the current implementation it does not include kernel socket buffer time. In the
  111. // current implementation it also does not include send window buffering inside the HTTP/2 codec.
  112. // In the future it is likely that work will be done to make this duration more accurate.
  113. google.protobuf.Duration time_to_last_downstream_tx_byte = 12;
  114. // The upstream remote/destination address that handles this exchange. This does not include
  115. // retries.
  116. config.core.v3.Address upstream_remote_address = 13;
  117. // The upstream local/origin address that handles this exchange. This does not include retries.
  118. config.core.v3.Address upstream_local_address = 14;
  119. // The upstream cluster that *upstream_remote_address* belongs to.
  120. string upstream_cluster = 15;
  121. // Flags indicating occurrences during request/response processing.
  122. ResponseFlags response_flags = 16;
  123. // All metadata encountered during request processing, including endpoint
  124. // selection.
  125. //
  126. // This can be used to associate IDs attached to the various configurations
  127. // used to process this request with the access log entry. For example, a
  128. // route created from a higher level forwarding rule with some ID can place
  129. // that ID in this field and cross reference later. It can also be used to
  130. // determine if a canary endpoint was used or not.
  131. config.core.v3.Metadata metadata = 17;
  132. // If upstream connection failed due to transport socket (e.g. TLS handshake), provides the
  133. // failure reason from the transport socket. The format of this field depends on the configured
  134. // upstream transport socket. Common TLS failures are in
  135. // :ref:`TLS trouble shooting <arch_overview_ssl_trouble_shooting>`.
  136. string upstream_transport_failure_reason = 18;
  137. // The name of the route
  138. string route_name = 19;
  139. // This field is the downstream direct remote address on which the request from the user was
  140. // received. Note: This is always the physical peer, even if the remote address is inferred from
  141. // for example the x-forwarder-for header, proxy protocol, etc.
  142. config.core.v3.Address downstream_direct_remote_address = 20;
  143. // Map of filter state in stream info that have been configured to be logged. If the filter
  144. // state serialized to any message other than `google.protobuf.Any` it will be packed into
  145. // `google.protobuf.Any`.
  146. map<string, google.protobuf.Any> filter_state_objects = 21;
  147. // A list of custom tags, which annotate logs with additional information.
  148. // To configure this value, users should configure
  149. // :ref:`custom_tags <envoy_v3_api_field_extensions.access_loggers.grpc.v3.CommonGrpcAccessLogConfig.custom_tags>`.
  150. map<string, string> custom_tags = 22;
  151. }
  152. // Flags indicating occurrences during request/response processing.
  153. // [#next-free-field: 27]
  154. message ResponseFlags {
  155. option (udpa.annotations.versioning).previous_message_type =
  156. "envoy.data.accesslog.v2.ResponseFlags";
  157. message Unauthorized {
  158. option (udpa.annotations.versioning).previous_message_type =
  159. "envoy.data.accesslog.v2.ResponseFlags.Unauthorized";
  160. // Reasons why the request was unauthorized
  161. enum Reason {
  162. REASON_UNSPECIFIED = 0;
  163. // The request was denied by the external authorization service.
  164. EXTERNAL_SERVICE = 1;
  165. }
  166. Reason reason = 1;
  167. }
  168. // Indicates local server healthcheck failed.
  169. bool failed_local_healthcheck = 1;
  170. // Indicates there was no healthy upstream.
  171. bool no_healthy_upstream = 2;
  172. // Indicates an there was an upstream request timeout.
  173. bool upstream_request_timeout = 3;
  174. // Indicates local codec level reset was sent on the stream.
  175. bool local_reset = 4;
  176. // Indicates remote codec level reset was received on the stream.
  177. bool upstream_remote_reset = 5;
  178. // Indicates there was a local reset by a connection pool due to an initial connection failure.
  179. bool upstream_connection_failure = 6;
  180. // Indicates the stream was reset due to an upstream connection termination.
  181. bool upstream_connection_termination = 7;
  182. // Indicates the stream was reset because of a resource overflow.
  183. bool upstream_overflow = 8;
  184. // Indicates no route was found for the request.
  185. bool no_route_found = 9;
  186. // Indicates that the request was delayed before proxying.
  187. bool delay_injected = 10;
  188. // Indicates that the request was aborted with an injected error code.
  189. bool fault_injected = 11;
  190. // Indicates that the request was rate-limited locally.
  191. bool rate_limited = 12;
  192. // Indicates if the request was deemed unauthorized and the reason for it.
  193. Unauthorized unauthorized_details = 13;
  194. // Indicates that the request was rejected because there was an error in rate limit service.
  195. bool rate_limit_service_error = 14;
  196. // Indicates the stream was reset due to a downstream connection termination.
  197. bool downstream_connection_termination = 15;
  198. // Indicates that the upstream retry limit was exceeded, resulting in a downstream error.
  199. bool upstream_retry_limit_exceeded = 16;
  200. // Indicates that the stream idle timeout was hit, resulting in a downstream 408.
  201. bool stream_idle_timeout = 17;
  202. // Indicates that the request was rejected because an envoy request header failed strict
  203. // validation.
  204. bool invalid_envoy_request_headers = 18;
  205. // Indicates there was an HTTP protocol error on the downstream request.
  206. bool downstream_protocol_error = 19;
  207. // Indicates there was a max stream duration reached on the upstream request.
  208. bool upstream_max_stream_duration_reached = 20;
  209. // Indicates the response was served from a cache filter.
  210. bool response_from_cache_filter = 21;
  211. // Indicates that a filter configuration is not available.
  212. bool no_filter_config_found = 22;
  213. // Indicates that request or connection exceeded the downstream connection duration.
  214. bool duration_timeout = 23;
  215. // Indicates there was an HTTP protocol error in the upstream response.
  216. bool upstream_protocol_error = 24;
  217. // Indicates no cluster was found for the request.
  218. bool no_cluster_found = 25;
  219. // Indicates overload manager terminated the request.
  220. bool overload_manager = 26;
  221. }
  222. // Properties of a negotiated TLS connection.
  223. // [#next-free-field: 7]
  224. message TLSProperties {
  225. option (udpa.annotations.versioning).previous_message_type =
  226. "envoy.data.accesslog.v2.TLSProperties";
  227. enum TLSVersion {
  228. VERSION_UNSPECIFIED = 0;
  229. TLSv1 = 1;
  230. TLSv1_1 = 2;
  231. TLSv1_2 = 3;
  232. TLSv1_3 = 4;
  233. }
  234. message CertificateProperties {
  235. option (udpa.annotations.versioning).previous_message_type =
  236. "envoy.data.accesslog.v2.TLSProperties.CertificateProperties";
  237. message SubjectAltName {
  238. option (udpa.annotations.versioning).previous_message_type =
  239. "envoy.data.accesslog.v2.TLSProperties.CertificateProperties.SubjectAltName";
  240. oneof san {
  241. string uri = 1;
  242. // [#not-implemented-hide:]
  243. string dns = 2;
  244. }
  245. }
  246. // SANs present in the certificate.
  247. repeated SubjectAltName subject_alt_name = 1;
  248. // The subject field of the certificate.
  249. string subject = 2;
  250. }
  251. // Version of TLS that was negotiated.
  252. TLSVersion tls_version = 1;
  253. // TLS cipher suite negotiated during handshake. The value is a
  254. // four-digit hex code defined by the IANA TLS Cipher Suite Registry
  255. // (e.g. ``009C`` for ``TLS_RSA_WITH_AES_128_GCM_SHA256``).
  256. //
  257. // Here it is expressed as an integer.
  258. google.protobuf.UInt32Value tls_cipher_suite = 2;
  259. // SNI hostname from handshake.
  260. string tls_sni_hostname = 3;
  261. // Properties of the local certificate used to negotiate TLS.
  262. CertificateProperties local_certificate_properties = 4;
  263. // Properties of the peer certificate used to negotiate TLS.
  264. CertificateProperties peer_certificate_properties = 5;
  265. // The TLS session ID.
  266. string tls_session_id = 6;
  267. }
  268. // [#next-free-field: 14]
  269. message HTTPRequestProperties {
  270. option (udpa.annotations.versioning).previous_message_type =
  271. "envoy.data.accesslog.v2.HTTPRequestProperties";
  272. // The request method (RFC 7231/2616).
  273. config.core.v3.RequestMethod request_method = 1 [(validate.rules).enum = {defined_only: true}];
  274. // The scheme portion of the incoming request URI.
  275. string scheme = 2;
  276. // HTTP/2 ``:authority`` or HTTP/1.1 ``Host`` header value.
  277. string authority = 3;
  278. // The port of the incoming request URI
  279. // (unused currently, as port is composed onto authority).
  280. google.protobuf.UInt32Value port = 4;
  281. // The path portion from the incoming request URI.
  282. string path = 5;
  283. // Value of the ``User-Agent`` request header.
  284. string user_agent = 6;
  285. // Value of the ``Referer`` request header.
  286. string referer = 7;
  287. // Value of the ``X-Forwarded-For`` request header.
  288. string forwarded_for = 8;
  289. // Value of the ``X-Request-Id`` request header
  290. //
  291. // This header is used by Envoy to uniquely identify a request.
  292. // It will be generated for all external requests and internal requests that
  293. // do not already have a request ID.
  294. string request_id = 9;
  295. // Value of the ``X-Envoy-Original-Path`` request header.
  296. string original_path = 10;
  297. // Size of the HTTP request headers in bytes.
  298. //
  299. // This value is captured from the OSI layer 7 perspective, i.e. it does not
  300. // include overhead from framing or encoding at other networking layers.
  301. uint64 request_headers_bytes = 11;
  302. // Size of the HTTP request body in bytes.
  303. //
  304. // This value is captured from the OSI layer 7 perspective, i.e. it does not
  305. // include overhead from framing or encoding at other networking layers.
  306. uint64 request_body_bytes = 12;
  307. // Map of additional headers that have been configured to be logged.
  308. map<string, string> request_headers = 13;
  309. }
  310. // [#next-free-field: 7]
  311. message HTTPResponseProperties {
  312. option (udpa.annotations.versioning).previous_message_type =
  313. "envoy.data.accesslog.v2.HTTPResponseProperties";
  314. // The HTTP response code returned by Envoy.
  315. google.protobuf.UInt32Value response_code = 1;
  316. // Size of the HTTP response headers in bytes.
  317. //
  318. // This value is captured from the OSI layer 7 perspective, i.e. it does not
  319. // include overhead from framing or encoding at other networking layers.
  320. uint64 response_headers_bytes = 2;
  321. // Size of the HTTP response body in bytes.
  322. //
  323. // This value is captured from the OSI layer 7 perspective, i.e. it does not
  324. // include overhead from framing or encoding at other networking layers.
  325. uint64 response_body_bytes = 3;
  326. // Map of additional headers configured to be logged.
  327. map<string, string> response_headers = 4;
  328. // Map of trailers configured to be logged.
  329. map<string, string> response_trailers = 5;
  330. // The HTTP response code details.
  331. string response_code_details = 6;
  332. }