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