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