request_log.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. // Copyright 2020 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.appengine.logging.v1;
  16. import "google/logging/type/log_severity.proto";
  17. import "google/protobuf/duration.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.AppEngine.Logging.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/appengine/logging/v1;logging";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "RequestLogProto";
  23. option java_package = "com.google.appengine.logging.v1";
  24. option php_namespace = "Google\\Cloud\\AppEngine\\Logging\\V1";
  25. option ruby_package = "Google::Cloud::AppEngine::Logging::V1";
  26. // Application log line emitted while processing a request.
  27. message LogLine {
  28. // Approximate time when this log entry was made.
  29. google.protobuf.Timestamp time = 1;
  30. // Severity of this log entry.
  31. google.logging.type.LogSeverity severity = 2;
  32. // App-provided log message.
  33. string log_message = 3;
  34. // Where in the source code this log message was written.
  35. SourceLocation source_location = 4;
  36. }
  37. // Specifies a location in a source code file.
  38. message SourceLocation {
  39. // Source file name. Depending on the runtime environment, this might be a
  40. // simple name or a fully-qualified name.
  41. string file = 1;
  42. // Line within the source file.
  43. int64 line = 2;
  44. // Human-readable name of the function or method being invoked, with optional
  45. // context such as the class or package name. This information is used in
  46. // contexts such as the logs viewer, where a file and line number are less
  47. // meaningful. The format can vary by language. For example:
  48. // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
  49. // (Python).
  50. string function_name = 3;
  51. }
  52. // A reference to a particular snapshot of the source tree used to build and
  53. // deploy an application.
  54. message SourceReference {
  55. // Optional. A URI string identifying the repository.
  56. // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
  57. string repository = 1;
  58. // The canonical and persistent identifier of the deployed revision.
  59. // Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
  60. string revision_id = 2;
  61. }
  62. // Complete log information about a single HTTP request to an App Engine
  63. // application.
  64. message RequestLog {
  65. // Application that handled this request.
  66. string app_id = 1;
  67. // Module of the application that handled this request.
  68. string module_id = 37;
  69. // Version of the application that handled this request.
  70. string version_id = 2;
  71. // Globally unique identifier for a request, which is based on the request
  72. // start time. Request IDs for requests which started later will compare
  73. // greater as strings than those for requests which started earlier.
  74. string request_id = 3;
  75. // Origin IP address.
  76. string ip = 4;
  77. // Time when the request started.
  78. google.protobuf.Timestamp start_time = 6;
  79. // Time when the request finished.
  80. google.protobuf.Timestamp end_time = 7;
  81. // Latency of the request.
  82. google.protobuf.Duration latency = 8;
  83. // Number of CPU megacycles used to process request.
  84. int64 mega_cycles = 9;
  85. // Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
  86. string method = 10;
  87. // Contains the path and query portion of the URL that was requested. For
  88. // example, if the URL was "http://example.com/app?name=val", the resource
  89. // would be "/app?name=val". The fragment identifier, which is identified by
  90. // the `#` character, is not included.
  91. string resource = 11;
  92. // HTTP version of request. Example: `"HTTP/1.1"`.
  93. string http_version = 12;
  94. // HTTP response status code. Example: 200, 404.
  95. int32 status = 13;
  96. // Size in bytes sent back to client by request.
  97. int64 response_size = 14;
  98. // Referrer URL of request.
  99. string referrer = 15;
  100. // User agent that made the request.
  101. string user_agent = 16;
  102. // The logged-in user who made the request.
  103. //
  104. // Most likely, this is the part of the user's email before the `@` sign. The
  105. // field value is the same for different requests from the same user, but
  106. // different users can have similar names. This information is also
  107. // available to the application via the App Engine Users API.
  108. //
  109. // This field will be populated starting with App Engine 1.9.21.
  110. string nickname = 40;
  111. // File or class that handled the request.
  112. string url_map_entry = 17;
  113. // Internet host and port number of the resource being requested.
  114. string host = 20;
  115. // An indication of the relative cost of serving this request.
  116. double cost = 21;
  117. // Queue name of the request, in the case of an offline request.
  118. string task_queue_name = 22;
  119. // Task name of the request, in the case of an offline request.
  120. string task_name = 23;
  121. // Whether this was a loading request for the instance.
  122. bool was_loading_request = 24;
  123. // Time this request spent in the pending request queue.
  124. google.protobuf.Duration pending_time = 25;
  125. // If the instance processing this request belongs to a manually scaled
  126. // module, then this is the 0-based index of the instance. Otherwise, this
  127. // value is -1.
  128. int32 instance_index = 26;
  129. // Whether this request is finished or active.
  130. bool finished = 27;
  131. // Whether this is the first `RequestLog` entry for this request. If an
  132. // active request has several `RequestLog` entries written to Stackdriver
  133. // Logging, then this field will be set for one of them.
  134. bool first = 42;
  135. // An identifier for the instance that handled the request.
  136. string instance_id = 28;
  137. // A list of log lines emitted by the application while serving this request.
  138. repeated LogLine line = 29;
  139. // App Engine release version.
  140. string app_engine_release = 38;
  141. // Stackdriver Trace identifier for this request.
  142. string trace_id = 39;
  143. // If true, the value in the 'trace_id' field was sampled for storage in a
  144. // trace backend.
  145. bool trace_sampled = 43;
  146. // Source code for the application that handled this request. There can be
  147. // more than one source reference per deployed application if source code is
  148. // distributed among multiple repositories.
  149. repeated SourceReference source_reference = 41;
  150. }