error_log.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.cloud.retail.logging;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/struct.proto";
  18. import "google/rpc/status.proto";
  19. option csharp_namespace = "Google.Cloud.Retail.Logging";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/retail/logging;logging";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ErrorLogProto";
  23. option java_package = "com.google.cloud.retail.logging";
  24. option objc_class_prefix = "RETAIL";
  25. option php_namespace = "Google\\Cloud\\Retail\\Logging";
  26. option ruby_package = "Google::Cloud::Retail::Logging";
  27. // Describes a running service that sends errors.
  28. message ServiceContext {
  29. // An identifier of the service.
  30. // For example, "retail.googleapis.com".
  31. string service = 1;
  32. }
  33. // HTTP request data that is related to a reported error.
  34. message HttpRequestContext {
  35. // The HTTP response status code for the request.
  36. int32 response_status_code = 1;
  37. }
  38. // Indicates a location in the source code of the service for which
  39. // errors are reported.
  40. message SourceLocation {
  41. // Human-readable name of a function or method.
  42. // For example, "google.cloud.retail.v2.UserEventService.ImportUserEvents".
  43. string function_name = 1;
  44. }
  45. // A description of the context in which an error occurred.
  46. message ErrorContext {
  47. // The HTTP request which was processed when the error was triggered.
  48. HttpRequestContext http_request = 1;
  49. // The location in the source code where the decision was made to
  50. // report the error, usually the place where it was logged.
  51. SourceLocation report_location = 2;
  52. }
  53. // The error payload that is populated on LRO import APIs. Including:
  54. // "google.cloud.retail.v2.ProductService.ImportProducts"
  55. // "google.cloud.retail.v2.EventService.ImportUserEvents"
  56. message ImportErrorContext {
  57. // The operation resource name of the LRO.
  58. string operation_name = 1;
  59. // Cloud Storage file path of the import source.
  60. // Can be set for batch operation error.
  61. string gcs_path = 2;
  62. // Line number of the content in file.
  63. // Should be empty for permission or batch operation error.
  64. string line_number = 3;
  65. // Detailed content which caused the error.
  66. // Should be empty for permission or batch operation error.
  67. oneof line_content {
  68. // The detailed content which caused the error on importing a catalog item.
  69. string catalog_item = 4;
  70. // The detailed content which caused the error on importing a product.
  71. string product = 5;
  72. // The detailed content which caused the error on importing a user event.
  73. string user_event = 6;
  74. }
  75. }
  76. // An error log which is reported to the Error Reporting system.
  77. // This proto a superset of
  78. // google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent.
  79. message ErrorLog {
  80. // The service context in which this error has occurred.
  81. ServiceContext service_context = 1;
  82. // A description of the context in which the error occurred.
  83. ErrorContext context = 2;
  84. // A message describing the error.
  85. string message = 3;
  86. // The RPC status associated with the error log.
  87. google.rpc.Status status = 4;
  88. // The API request payload, represented as a protocol buffer.
  89. //
  90. // Most API request types are supported. For example:
  91. //
  92. // "type.googleapis.com/google.cloud.retail.v2.ProductService.CreateProductRequest"
  93. // "type.googleapis.com/google.cloud.retail.v2.UserEventService.WriteUserEventRequest"
  94. google.protobuf.Struct request_payload = 5;
  95. // The API response payload, represented as a protocol buffer.
  96. //
  97. // This is used to log some "soft errors", where the response is valid but we
  98. // consider there are some quality issues like unjoined events.
  99. //
  100. // The following API responses are supported and no PII is included:
  101. // "google.cloud.retail.v2.PredictionService.Predict"
  102. // "google.cloud.retail.v2.UserEventService.WriteUserEvent"
  103. // "google.cloud.retail.v2.UserEventService.CollectUserEvent"
  104. google.protobuf.Struct response_payload = 6;
  105. // The error payload that is populated on LRO import APIs.
  106. ImportErrorContext import_payload = 7;
  107. }