http_request.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.api.servicecontrol.v1;
  16. import "google/protobuf/duration.proto";
  17. option csharp_namespace = "Google.Cloud.ServiceControl.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "HttpRequestProto";
  21. option java_package = "com.google.api.servicecontrol.v1";
  22. option php_namespace = "Google\\Cloud\\ServiceControl\\V1";
  23. option ruby_package = "Google::Cloud::ServiceControl::V1";
  24. // A common proto for logging HTTP requests. Only contains semantics
  25. // defined by the HTTP specification. Product-specific logging
  26. // information MUST be defined in a separate message.
  27. message HttpRequest {
  28. // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
  29. string request_method = 1;
  30. // The scheme (http, https), the host name, the path, and the query
  31. // portion of the URL that was requested.
  32. // Example: `"http://example.com/some/info?color=red"`.
  33. string request_url = 2;
  34. // The size of the HTTP request message in bytes, including the request
  35. // headers and the request body.
  36. int64 request_size = 3;
  37. // The response code indicating the status of the response.
  38. // Examples: 200, 404.
  39. int32 status = 4;
  40. // The size of the HTTP response message sent back to the client, in bytes,
  41. // including the response headers and the response body.
  42. int64 response_size = 5;
  43. // The user agent sent by the client. Example:
  44. // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
  45. // CLR 1.0.3705)"`.
  46. string user_agent = 6;
  47. // The IP address (IPv4 or IPv6) of the client that issued the HTTP
  48. // request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
  49. string remote_ip = 7;
  50. // The IP address (IPv4 or IPv6) of the origin server that the request was
  51. // sent to.
  52. string server_ip = 13;
  53. // The referer URL of the request, as defined in
  54. // [HTTP/1.1 Header Field
  55. // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
  56. string referer = 8;
  57. // The request processing latency on the server, from the time the request was
  58. // received until the response was sent.
  59. google.protobuf.Duration latency = 14;
  60. // Whether or not a cache lookup was attempted.
  61. bool cache_lookup = 11;
  62. // Whether or not an entity was served from cache
  63. // (with or without validation).
  64. bool cache_hit = 9;
  65. // Whether or not the response was validated with the origin server before
  66. // being served from cache. This field is only meaningful if `cache_hit` is
  67. // True.
  68. bool cache_validated_with_origin_server = 10;
  69. // The number of HTTP response bytes inserted into cache. Set only when a
  70. // cache fill was attempted.
  71. int64 cache_fill_bytes = 12;
  72. // Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
  73. string protocol = 15;
  74. }