common.proto 7.3 KB

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