common.proto 7.3 KB

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