|
| 1 | +// Copyright 2018 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 | +// |
| 15 | + |
| 16 | +syntax = "proto3"; |
| 17 | + |
| 18 | +package google.logging.v2; |
| 19 | + |
| 20 | +import "google/api/annotations.proto"; |
| 21 | +import "google/api/monitored_resource.proto"; |
| 22 | +import "google/logging/type/http_request.proto"; |
| 23 | +import "google/logging/type/log_severity.proto"; |
| 24 | +import "google/protobuf/any.proto"; |
| 25 | +import "google/protobuf/struct.proto"; |
| 26 | +import "google/protobuf/timestamp.proto"; |
| 27 | + |
| 28 | +option cc_enable_arenas = true; |
| 29 | +option csharp_namespace = "Google.Cloud.Logging.V2"; |
| 30 | +option go_package = "google.golang.org/genproto/googleapis/logging/v2;logging"; |
| 31 | +option java_multiple_files = true; |
| 32 | +option java_outer_classname = "LogEntryProto"; |
| 33 | +option java_package = "com.google.logging.v2"; |
| 34 | +option php_namespace = "Google\\Cloud\\Logging\\V2"; |
| 35 | + |
| 36 | + |
| 37 | +// An individual entry in a log. |
| 38 | +message LogEntry { |
| 39 | + // Required. The resource name of the log to which this log entry belongs: |
| 40 | + // |
| 41 | + // "projects/[PROJECT_ID]/logs/[LOG_ID]" |
| 42 | + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" |
| 43 | + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" |
| 44 | + // "folders/[FOLDER_ID]/logs/[LOG_ID]" |
| 45 | + // |
| 46 | + // A project number may optionally be used in place of PROJECT_ID. The |
| 47 | + // project number is translated to its corresponding PROJECT_ID internally |
| 48 | + // and the `log_name` field will contain PROJECT_ID in queries and exports. |
| 49 | + // |
| 50 | + // `[LOG_ID]` must be URL-encoded within `log_name`. Example: |
| 51 | + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. |
| 52 | + // `[LOG_ID]` must be less than 512 characters long and can only include the |
| 53 | + // following characters: upper and lower case alphanumeric characters, |
| 54 | + // forward-slash, underscore, hyphen, and period. |
| 55 | + // |
| 56 | + // For backward compatibility, if `log_name` begins with a forward-slash, such |
| 57 | + // as `/projects/...`, then the log entry is ingested as usual but the |
| 58 | + // forward-slash is removed. Listing the log entry will not show the leading |
| 59 | + // slash and filtering for a log name with a leading slash will never return |
| 60 | + // any results. |
| 61 | + string log_name = 12; |
| 62 | + |
| 63 | + // Required. The primary monitored resource associated with this log entry. |
| 64 | + // Example: a log entry that reports a database error would be |
| 65 | + // associated with the monitored resource designating the particular |
| 66 | + // database that reported the error. |
| 67 | + google.api.MonitoredResource resource = 8; |
| 68 | + |
| 69 | + // Optional. The log entry payload, which can be one of multiple types. |
| 70 | + oneof payload { |
| 71 | + // The log entry payload, represented as a protocol buffer. Some |
| 72 | + // Google Cloud Platform services use this field for their log |
| 73 | + // entry payloads. |
| 74 | + google.protobuf.Any proto_payload = 2; |
| 75 | + |
| 76 | + // The log entry payload, represented as a Unicode string (UTF-8). |
| 77 | + string text_payload = 3; |
| 78 | + |
| 79 | + // The log entry payload, represented as a structure that is |
| 80 | + // expressed as a JSON object. |
| 81 | + google.protobuf.Struct json_payload = 6; |
| 82 | + } |
| 83 | + |
| 84 | + // Optional. The time the event described by the log entry occurred. |
| 85 | + // This time is used to compute the log entry's age and to enforce |
| 86 | + // the logs retention period. If this field is omitted in a new log |
| 87 | + // entry, then Logging assigns it the current time. |
| 88 | + // Timestamps have nanosecond accuracy, but trailing zeros in the fractional |
| 89 | + // seconds might be omitted when the timestamp is displayed. |
| 90 | + // |
| 91 | + // Incoming log entries should have timestamps that are no more than |
| 92 | + // the [logs retention period](/logging/quotas) in the past, |
| 93 | + // and no more than 24 hours in the future. Log entries outside those time |
| 94 | + // boundaries will not be available when calling `entries.list`, but |
| 95 | + // those log entries can still be exported with |
| 96 | + // [LogSinks](/logging/docs/api/tasks/exporting-logs). |
| 97 | + google.protobuf.Timestamp timestamp = 9; |
| 98 | + |
| 99 | + // Output only. The time the log entry was received by Logging. |
| 100 | + google.protobuf.Timestamp receive_timestamp = 24; |
| 101 | + |
| 102 | + // Optional. The severity of the log entry. The default value is |
| 103 | + // `LogSeverity.DEFAULT`. |
| 104 | + google.logging.type.LogSeverity severity = 10; |
| 105 | + |
| 106 | + // Optional. A unique identifier for the log entry. If you provide a value, |
| 107 | + // then Logging considers other log entries in the same project, |
| 108 | + // with the same `timestamp`, and with the same `insert_id` to be duplicates |
| 109 | + // which can be removed. If omitted in new log entries, then |
| 110 | + // Logging assigns its own unique identifier. The `insert_id` is also used |
| 111 | + // to order log entries that have the same `timestamp` value. |
| 112 | + string insert_id = 4; |
| 113 | + |
| 114 | + // Optional. Information about the HTTP request associated with this |
| 115 | + // log entry, if applicable. |
| 116 | + google.logging.type.HttpRequest http_request = 7; |
| 117 | + |
| 118 | + // Optional. A set of user-defined (key, value) data that provides additional |
| 119 | + // information about the log entry. |
| 120 | + map<string, string> labels = 11; |
| 121 | + |
| 122 | + // Output only. Additional metadata about the monitored resource. |
| 123 | + // Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have |
| 124 | + // this field populated. |
| 125 | + google.api.MonitoredResourceMetadata metadata = 25; |
| 126 | + |
| 127 | + // Optional. Information about an operation associated with the log entry, if |
| 128 | + // applicable. |
| 129 | + LogEntryOperation operation = 15; |
| 130 | + |
| 131 | + // Optional. Resource name of the trace associated with the log entry, if any. |
| 132 | + // If it contains a relative resource name, the name is assumed to be relative |
| 133 | + // to `//tracing.googleapis.com`. Example: |
| 134 | + // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` |
| 135 | + string trace = 22; |
| 136 | + |
| 137 | + // Optional. The span ID within the trace associated with the log entry. |
| 138 | + // For Trace spans, this is the same format that the Trace |
| 139 | + // API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such |
| 140 | + // as <code>"000000000000004a"</code>. |
| 141 | + string span_id = 27; |
| 142 | + |
| 143 | + // Optional. The sampling decision of the trace associated with the log entry. |
| 144 | + // True means that the trace resource name in the `trace` field was sampled |
| 145 | + // for storage in a trace backend. False means that the trace was not sampled |
| 146 | + // for storage when this log entry was written, or the sampling decision was |
| 147 | + // unknown at the time. A non-sampled `trace` value is still useful as a |
| 148 | + // request correlation identifier. The default is False. |
| 149 | + bool trace_sampled = 30; |
| 150 | + |
| 151 | + // Optional. Source code location information associated with the log entry, |
| 152 | + // if any. |
| 153 | + LogEntrySourceLocation source_location = 23; |
| 154 | +} |
| 155 | + |
| 156 | +// Additional information about a potentially long-running operation with which |
| 157 | +// a log entry is associated. |
| 158 | +message LogEntryOperation { |
| 159 | + // Optional. An arbitrary operation identifier. Log entries with the |
| 160 | + // same identifier are assumed to be part of the same operation. |
| 161 | + string id = 1; |
| 162 | + |
| 163 | + // Optional. An arbitrary producer identifier. The combination of |
| 164 | + // `id` and `producer` must be globally unique. Examples for `producer`: |
| 165 | + // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. |
| 166 | + string producer = 2; |
| 167 | + |
| 168 | + // Optional. Set this to True if this is the first log entry in the operation. |
| 169 | + bool first = 3; |
| 170 | + |
| 171 | + // Optional. Set this to True if this is the last log entry in the operation. |
| 172 | + bool last = 4; |
| 173 | +} |
| 174 | + |
| 175 | +// Additional information about the source code location that produced the log |
| 176 | +// entry. |
| 177 | +message LogEntrySourceLocation { |
| 178 | + // Optional. Source file name. Depending on the runtime environment, this |
| 179 | + // might be a simple name or a fully-qualified name. |
| 180 | + string file = 1; |
| 181 | + |
| 182 | + // Optional. Line within the source file. 1-based; 0 indicates no line number |
| 183 | + // available. |
| 184 | + int64 line = 2; |
| 185 | + |
| 186 | + // Optional. Human-readable name of the function or method being invoked, with |
| 187 | + // optional context such as the class or package name. This information may be |
| 188 | + // used in contexts such as the logs viewer, where a file and line number are |
| 189 | + // less meaningful. The format can vary by language. For example: |
| 190 | + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` |
| 191 | + // (Python). |
| 192 | + string function = 3; |
| 193 | +} |
0 commit comments