1
- // Copyright 2022 Google LLC
1
+ // Copyright 2023 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -75,7 +75,8 @@ message LogEntry {
75
75
// Example: a log entry that reports a database error would be associated with
76
76
// the monitored resource designating the particular database that reported
77
77
// the error.
78
- google.api.MonitoredResource resource = 8 [(google.api.field_behavior ) = REQUIRED ];
78
+ google.api.MonitoredResource resource = 8
79
+ [(google.api.field_behavior ) = REQUIRED ];
79
80
80
81
// The log entry payload, which can be one of multiple types.
81
82
oneof payload {
@@ -97,27 +98,32 @@ message LogEntry {
97
98
google.protobuf.Struct json_payload = 6 ;
98
99
}
99
100
100
- // Optional. The time the event described by the log entry occurred. This time is used
101
- // to compute the log entry's age and to enforce the logs retention period.
102
- // If this field is omitted in a new log entry, then Logging assigns it the
103
- // current time. Timestamps have nanosecond accuracy, but trailing zeros in
104
- // the fractional seconds might be omitted when the timestamp is displayed.
101
+ // Optional. The time the event described by the log entry occurred. This time
102
+ // is used to compute the log entry's age and to enforce the logs retention
103
+ // period. If this field is omitted in a new log entry, then Logging assigns
104
+ // it the current time. Timestamps have nanosecond accuracy, but trailing
105
+ // zeros in the fractional seconds might be omitted when the timestamp is
106
+ // displayed.
105
107
//
106
108
// Incoming log entries must have timestamps that don't exceed the
107
109
// [logs retention
108
110
// period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
109
111
// the past, and that don't exceed 24 hours in the future. Log entries outside
110
112
// those time boundaries aren't ingested by Logging.
111
- google.protobuf.Timestamp timestamp = 9 [(google.api.field_behavior ) = OPTIONAL ];
113
+ google.protobuf.Timestamp timestamp = 9
114
+ [(google.api.field_behavior ) = OPTIONAL ];
112
115
113
116
// Output only. The time the log entry was received by Logging.
114
- google.protobuf.Timestamp receive_timestamp = 24 [(google.api.field_behavior ) = OUTPUT_ONLY ];
117
+ google.protobuf.Timestamp receive_timestamp = 24
118
+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
115
119
116
- // Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
117
- google.logging.type.LogSeverity severity = 10 [(google.api.field_behavior ) = OPTIONAL ];
120
+ // Optional. The severity of the log entry. The default value is
121
+ // `LogSeverity.DEFAULT`.
122
+ google.logging.type.LogSeverity severity = 10
123
+ [(google.api.field_behavior ) = OPTIONAL ];
118
124
119
- // Optional. A unique identifier for the log entry. If you provide a value, then
120
- // Logging considers other log entries in the same project, with the same
125
+ // Optional. A unique identifier for the log entry. If you provide a value,
126
+ // then Logging considers other log entries in the same project, with the same
121
127
// `timestamp`, and with the same `insert_id` to be duplicates which are
122
128
// removed in a single query result. However, there are no guarantees of
123
129
// de-duplication in the export of logs.
@@ -129,12 +135,13 @@ message LogEntry {
129
135
// the same `log_name` and `timestamp` values.
130
136
string insert_id = 4 [(google.api.field_behavior ) = OPTIONAL ];
131
137
132
- // Optional. Information about the HTTP request associated with this log entry, if
133
- // applicable.
134
- google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior ) = OPTIONAL ];
138
+ // Optional. Information about the HTTP request associated with this log
139
+ // entry, if applicable.
140
+ google.logging.type.HttpRequest http_request = 7
141
+ [(google.api.field_behavior ) = OPTIONAL ];
135
142
136
- // Optional. A map of key, value pairs that provides additional information about the
137
- // log entry. The labels can be user-defined or system-defined.
143
+ // Optional. A map of key, value pairs that provides additional information
144
+ // about the log entry. The labels can be user-defined or system-defined.
138
145
//
139
146
// User-defined labels are arbitrary key, value pairs that you can use to
140
147
// classify logs.
@@ -153,17 +160,47 @@ message LogEntry {
153
160
// applicable.
154
161
LogEntryOperation operation = 15 [(google.api.field_behavior ) = OPTIONAL ];
155
162
156
- // Optional. Resource name of the trace associated with the log entry, if any. If it
157
- // contains a relative resource name, the name is assumed to be relative to
158
- // `//tracing.googleapis.com`. Example:
159
- // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
163
+ // Optional. The REST resource name of the trace being written to
164
+ // [Cloud Trace](https://cloud.google.com/trace) in
165
+ // association with this log entry. For example, if your trace data is stored
166
+ // in the Cloud project "my-trace-project" and if the service that is creating
167
+ // the log entry receives a trace header that includes the trace ID "12345",
168
+ // then the service should use "projects/my-tracing-project/traces/12345".
169
+ //
170
+ // The `trace` field provides the link between logs and traces. By using
171
+ // this field, you can navigate from a log entry to a trace.
160
172
string trace = 22 [(google.api.field_behavior ) = OPTIONAL ];
161
173
162
- // Optional. The span ID within the trace associated with the log entry.
174
+ // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
175
+ // associated with the current operation in which the log is being written.
176
+ // For example, if a span has the REST resource name of
177
+ // "projects/some-project/traces/some-trace/spans/some-span-id", then the
178
+ // `span_id` field is "some-span-id".
179
+ //
180
+ // A
181
+ // [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
182
+ // represents a single operation within a trace. Whereas a trace may involve
183
+ // multiple different microservices running on multiple different machines,
184
+ // a span generally corresponds to a single logical operation being performed
185
+ // in a single instance of a microservice on one specific machine. Spans
186
+ // are the nodes within the tree that is a trace.
187
+ //
188
+ // Applications that are [instrumented for
189
+ // tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
190
+ // new, unique span ID on each incoming request. It is also common to create
191
+ // and record additional spans corresponding to internal processing elements
192
+ // as well as issuing requests to dependencies.
193
+ //
194
+ // The span ID is expected to be a 16-character, hexadecimal encoding of an
195
+ // 8-byte array and should not be zero. It should be unique within the trace
196
+ // and should, ideally, be generated in a manner that is uniformly random.
197
+ //
198
+ // Example values:
163
199
//
164
- // For Trace spans, this is the same format that the Trace API v2 uses: a
165
- // 16-character hexadecimal encoding of an 8-byte array, such as
166
- // `000000000000004a`.
200
+ // - `000000000000004a`
201
+ // - `7a2190356c3fc94b`
202
+ // - `0000f00300090021`
203
+ // - `d39223e101960076`
167
204
string span_id = 27 [(google.api.field_behavior ) = OPTIONAL ];
168
205
169
206
// Optional. The sampling decision of the trace associated with the log entry.
@@ -175,11 +212,13 @@ message LogEntry {
175
212
// request correlation identifier. The default is False.
176
213
bool trace_sampled = 30 [(google.api.field_behavior ) = OPTIONAL ];
177
214
178
- // Optional. Source code location information associated with the log entry, if any.
179
- LogEntrySourceLocation source_location = 23 [(google.api.field_behavior ) = OPTIONAL ];
215
+ // Optional. Source code location information associated with the log entry,
216
+ // if any.
217
+ LogEntrySourceLocation source_location = 23
218
+ [(google.api.field_behavior ) = OPTIONAL ];
180
219
181
- // Optional. Information indicating this LogEntry is part of a sequence of multiple log
182
- // entries split from a single LogEntry.
220
+ // Optional. Information indicating this LogEntry is part of a sequence of
221
+ // multiple log entries split from a single LogEntry.
183
222
LogSplit split = 35 [(google.api.field_behavior ) = OPTIONAL ];
184
223
}
185
224
0 commit comments