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 15syntax = "proto3"; 16 17package google.devtools.clouderrorreporting.v1beta1; 18 19import "google/api/resource.proto"; 20import "google/protobuf/timestamp.proto"; 21 22option cc_enable_arenas = true; 23option csharp_namespace = "Google.Cloud.ErrorReporting.V1Beta1"; 24option go_package = "cloud.google.com/go/errorreporting/apiv1beta1/errorreportingpb;errorreportingpb"; 25option java_multiple_files = true; 26option java_outer_classname = "CommonProto"; 27option java_package = "com.google.devtools.clouderrorreporting.v1beta1"; 28option php_namespace = "Google\\Cloud\\ErrorReporting\\V1beta1"; 29option ruby_package = "Google::Cloud::ErrorReporting::V1beta1"; 30 31// Description of a group of similar error events. 32message ErrorGroup { 33 option (google.api.resource) = { 34 type: "clouderrorreporting.googleapis.com/ErrorGroup" 35 pattern: "projects/{project}/groups/{group}" 36 }; 37 38 // The group resource name. 39 // Example: <code>projects/my-project-123/groups/CNSgkpnppqKCUw</code> 40 string name = 1; 41 42 // Group IDs are unique for a given project. If the same kind of error 43 // occurs in different service contexts, it will receive the same group ID. 44 string group_id = 2; 45 46 // Associated tracking issues. 47 repeated TrackingIssue tracking_issues = 3; 48 49 // Error group's resolution status. 50 // An unspecified resolution status will be interpreted as OPEN 51 ResolutionStatus resolution_status = 5; 52} 53 54// Information related to tracking the progress on resolving the error. 55message TrackingIssue { 56 // A URL pointing to a related entry in an issue tracking system. 57 // Example: `https://github.com/user/project/issues/4` 58 string url = 1; 59} 60 61// An error event which is returned by the Error Reporting system. 62message ErrorEvent { 63 // Time when the event occurred as provided in the error report. 64 // If the report did not contain a timestamp, the time the error was received 65 // by the Error Reporting system is used. 66 google.protobuf.Timestamp event_time = 1; 67 68 // The `ServiceContext` for which this error was reported. 69 ServiceContext service_context = 2; 70 71 // The stack trace that was reported or logged by the service. 72 string message = 3; 73 74 // Data about the context in which the error occurred. 75 ErrorContext context = 5; 76} 77 78// Describes a running service that sends errors. 79// Its version changes over time and multiple versions can run in parallel. 80message ServiceContext { 81 // An identifier of the service, such as the name of the 82 // executable, job, or Google App Engine service name. This field is expected 83 // to have a low number of values that are relatively stable over time, as 84 // opposed to `version`, which can be changed whenever new code is deployed. 85 // 86 // Contains the service name for error reports extracted from Google 87 // App Engine logs or `default` if the App Engine default service is used. 88 string service = 2; 89 90 // Represents the source code version that the developer provided, 91 // which could represent a version label or a Git SHA-1 hash, for example. 92 // For App Engine standard environment, the version is set to the version of 93 // the app. 94 string version = 3; 95 96 // Type of the MonitoredResource. List of possible values: 97 // https://cloud.google.com/monitoring/api/resources 98 // 99 // Value is set automatically for incoming errors and must not be set when 100 // reporting errors. 101 string resource_type = 4; 102} 103 104// A description of the context in which an error occurred. 105// This data should be provided by the application when reporting an error, 106// unless the 107// error report has been generated automatically from Google App Engine logs. 108message ErrorContext { 109 // The HTTP request which was processed when the error was 110 // triggered. 111 HttpRequestContext http_request = 1; 112 113 // The user who caused or was affected by the crash. 114 // This can be a user ID, an email address, or an arbitrary token that 115 // uniquely identifies the user. 116 // When sending an error report, leave this field empty if the user was not 117 // logged in. In this case the 118 // Error Reporting system will use other data, such as remote IP address, to 119 // distinguish affected users. See `affected_users_count` in 120 // `ErrorGroupStats`. 121 string user = 2; 122 123 // The location in the source code where the decision was made to 124 // report the error, usually the place where it was logged. 125 // For a logged exception this would be the source line where the 126 // exception is logged, usually close to the place where it was 127 // caught. 128 SourceLocation report_location = 3; 129} 130 131// HTTP request data that is related to a reported error. 132// This data should be provided by the application when reporting an error, 133// unless the 134// error report has been generated automatically from Google App Engine logs. 135message HttpRequestContext { 136 // The type of HTTP request, such as `GET`, `POST`, etc. 137 string method = 1; 138 139 // The URL of the request. 140 string url = 2; 141 142 // The user agent information that is provided with the request. 143 string user_agent = 3; 144 145 // The referrer information that is provided with the request. 146 string referrer = 4; 147 148 // The HTTP response status code for the request. 149 int32 response_status_code = 5; 150 151 // The IP address from which the request originated. 152 // This can be IPv4, IPv6, or a token which is derived from the 153 // IP address, depending on the data that has been provided 154 // in the error report. 155 string remote_ip = 6; 156} 157 158// Indicates a location in the source code of the service for which errors are 159// reported. `functionName` must be provided by the application when reporting 160// an error, unless the error report contains a `message` with a supported 161// exception stack trace. All fields are optional for the later case. 162message SourceLocation { 163 // The source code filename, which can include a truncated relative 164 // path, or a full path from a production machine. 165 string file_path = 1; 166 167 // 1-based. 0 indicates that the line number is unknown. 168 int32 line_number = 2; 169 170 // Human-readable name of a function or method. 171 // The value can include optional context like the class or package name. 172 // For example, `my.package.MyClass.method` in case of Java. 173 string function_name = 4; 174} 175 176// Resolution status of an error group. 177enum ResolutionStatus { 178 // Status is unknown. When left unspecified in requests, it is treated like 179 // OPEN. 180 RESOLUTION_STATUS_UNSPECIFIED = 0; 181 182 // The error group is not being addressed. This is the default for 183 // new groups. It is also used for errors re-occurring after marked RESOLVED. 184 OPEN = 1; 185 186 // Error Group manually acknowledged, it can have an issue link attached. 187 ACKNOWLEDGED = 2; 188 189 // Error Group manually resolved, more events for this group are not expected 190 // to occur. 191 RESOLVED = 3; 192 193 // The error group is muted and excluded by default on group stats requests. 194 MUTED = 4; 195} 196