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