error_log.proto 4.5 KB

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