Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 5eddc7d

Browse files
docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#1229)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: googleapis/googleapis@84594b3 Source-Link: googleapis/googleapis-gen@ed74f97 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 feat: Update Logging API with latest changes PiperOrigin-RevId: 429289471 Source-Link: googleapis/googleapis@acd5f89 Source-Link: googleapis/googleapis-gen@8a12622 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGExMjYyMjUzNmFlMmU5YTg5NzgxOThhMTUxZTg5MjM0YjgzOWIyMCJ9
1 parent c1d9e36 commit 5eddc7d

53 files changed

Lines changed: 18868 additions & 7976 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

protos/google/logging/v2/log_entry.proto

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.logging.v2;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/field_behavior.proto";
2021
import "google/api/monitored_resource.proto";
2122
import "google/api/resource.proto";
@@ -24,8 +25,6 @@ import "google/logging/type/log_severity.proto";
2425
import "google/protobuf/any.proto";
2526
import "google/protobuf/struct.proto";
2627
import "google/protobuf/timestamp.proto";
27-
import "google/rpc/status.proto";
28-
import "google/api/annotations.proto";
2928

3029
option cc_enable_arenas = true;
3130
option csharp_namespace = "Google.Cloud.Logging.V2";
@@ -37,8 +36,6 @@ option php_namespace = "Google\\Cloud\\Logging\\V2";
3736
option ruby_package = "Google::Cloud::Logging::V2";
3837

3938
// An individual entry in a log.
40-
//
41-
//
4239
message LogEntry {
4340
option (google.api.resource) = {
4441
type: "logging.googleapis.com/Log"
@@ -62,12 +59,13 @@ message LogEntry {
6259
//
6360
// `[LOG_ID]` must be URL-encoded within `log_name`. Example:
6461
// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
62+
//
6563
// `[LOG_ID]` must be less than 512 characters long and can only include the
6664
// following characters: upper and lower case alphanumeric characters,
6765
// forward-slash, underscore, hyphen, and period.
6866
//
6967
// For backward compatibility, if `log_name` begins with a forward-slash, such
70-
// as `/projects/...`, then the log entry is ingested as usual but the
68+
// as `/projects/...`, then the log entry is ingested as usual, but the
7169
// forward-slash is removed. Listing the log entry will not show the leading
7270
// slash and filtering for a log name with a leading slash will never return
7371
// any results.
@@ -126,7 +124,7 @@ message LogEntry {
126124
// de-duplication in the export of logs.
127125
//
128126
// If the `insert_id` is omitted when writing a log entry, the Logging API
129-
// assigns its own unique identifier in this field.
127+
// assigns its own unique identifier in this field.
130128
//
131129
// In queries, the `insert_id` is also used to order log entries that have
132130
// the same `log_name` and `timestamp` values.
@@ -136,8 +134,20 @@ message LogEntry {
136134
// applicable.
137135
google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior) = OPTIONAL];
138136

139-
// Optional. A set of user-defined (key, value) data that provides additional
140-
// information about the log entry.
137+
// Optional. A map of key, value pairs that provides additional information about the
138+
// log entry. The labels can be user-defined or system-defined.
139+
//
140+
// User-defined labels are arbitrary key, value pairs that you can use to
141+
// classify logs.
142+
//
143+
// System-defined labels are defined by GCP services for platform logs.
144+
// They have two components - a service namespace component and the
145+
// attribute name. For example: `compute.googleapis.com/resource_name`.
146+
//
147+
// Cloud Logging truncates label keys that exceed 512 B and label
148+
// values that exceed 64 KB upon their associated log entry being
149+
// written. The truncation is indicated by an ellipsis at the
150+
// end of the character string.
141151
map<string, string> labels = 11 [(google.api.field_behavior) = OPTIONAL];
142152

143153
// Optional. Information about an operation associated with the log entry, if
@@ -168,6 +178,10 @@ message LogEntry {
168178

169179
// Optional. Source code location information associated with the log entry, if any.
170180
LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL];
181+
182+
// Optional. Information indicating this LogEntry is part of a sequence of multiple log
183+
// entries split from a single LogEntry.
184+
LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL];
171185
}
172186

173187
// Additional information about a potentially long-running operation with which
@@ -208,3 +222,21 @@ message LogEntrySourceLocation {
208222
// (Python).
209223
string function = 3 [(google.api.field_behavior) = OPTIONAL];
210224
}
225+
226+
// Additional information used to correlate multiple log entries. Used when a
227+
// single LogEntry would exceed the Google Cloud Logging size limit and is
228+
// split across multiple log entries.
229+
message LogSplit {
230+
// A globally unique identifier for all log entries in a sequence of split log
231+
// entries. All log entries with the same |LogSplit.uid| are assumed to be
232+
// part of the same sequence of split log entries.
233+
string uid = 1;
234+
235+
// The index of this LogEntry in the sequence of split log entries. Log
236+
// entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
237+
// entries.
238+
int32 index = 2;
239+
240+
// The total number of log entries that the original LogEntry was split into.
241+
int32 total_splits = 3;
242+
}

protos/google/logging/v2/logging.proto

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.logging.v2;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/client.proto";
2021
import "google/api/field_behavior.proto";
2122
import "google/api/monitored_resource.proto";
@@ -27,7 +28,6 @@ import "google/protobuf/empty.proto";
2728
import "google/protobuf/field_mask.proto";
2829
import "google/protobuf/timestamp.proto";
2930
import "google/rpc/status.proto";
30-
import "google/api/annotations.proto";
3131

3232
option cc_enable_arenas = true;
3333
option csharp_namespace = "Google.Cloud.Logging.V2";
@@ -48,10 +48,10 @@ service LoggingServiceV2 {
4848
"https://www.googleapis.com/auth/logging.read,"
4949
"https://www.googleapis.com/auth/logging.write";
5050

51-
// Deletes all the log entries in a log. The log reappears if it receives new
52-
// entries. Log entries written shortly before the delete operation might not
53-
// be deleted. Entries received after the delete operation with a timestamp
54-
// before the operation will be deleted.
51+
// Deletes all the log entries in a log for the _Default Log Bucket. The log
52+
// reappears if it receives new entries. Log entries written shortly before
53+
// the delete operation might not be deleted. Entries received after the
54+
// delete operation with a timestamp before the operation will be deleted.
5555
rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) {
5656
option (google.api.http) = {
5757
delete: "/v2/{log_name=projects/*/logs/*}"
@@ -140,14 +140,15 @@ service LoggingServiceV2 {
140140
message DeleteLogRequest {
141141
// Required. The resource name of the log to delete:
142142
//
143-
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
144-
// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
145-
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
146-
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
143+
// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
144+
// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
145+
// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
146+
// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
147147
//
148148
// `[LOG_ID]` must be URL-encoded. For example,
149149
// `"projects/my-project-id/logs/syslog"`,
150-
// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
150+
// `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
151+
//
151152
// For more information about log names, see
152153
// [LogEntry][google.logging.v2.LogEntry].
153154
string log_name = 1 [
@@ -163,15 +164,15 @@ message WriteLogEntriesRequest {
163164
// Optional. A default log resource name that is assigned to all log entries
164165
// in `entries` that do not specify a value for `log_name`:
165166
//
166-
// "projects/[PROJECT_ID]/logs/[LOG_ID]"
167-
// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
168-
// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
169-
// "folders/[FOLDER_ID]/logs/[LOG_ID]"
167+
// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
168+
// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
169+
// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
170+
// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
170171
//
171172
// `[LOG_ID]` must be URL-encoded. For example:
172173
//
173174
// "projects/my-project-id/logs/syslog"
174-
// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
175+
// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
175176
//
176177
// The permission `logging.logEntries.create` is needed on each project,
177178
// organization, billing account, or folder that is receiving new log
@@ -214,14 +215,14 @@ message WriteLogEntriesRequest {
214215
// the entries later in the list. See the `entries.list` method.
215216
//
216217
// Log entries with timestamps that are more than the
217-
// [logs retention period](https://cloud.google.com/logging/quota-policy) in
218+
// [logs retention period](https://cloud.google.com/logging/quotas) in
218219
// the past or more than 24 hours in the future will not be available when
219220
// calling `entries.list`. However, those log entries can still be [exported
220221
// with
221222
// LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
222223
//
223224
// To improve throughput and to avoid exceeding the
224-
// [quota limit](https://cloud.google.com/logging/quota-policy) for calls to
225+
// [quota limit](https://cloud.google.com/logging/quotas) for calls to
225226
// `entries.write`, you should try to include several log entries in this
226227
// list, rather than calling this method for each individual log entry.
227228
repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED];
@@ -258,16 +259,17 @@ message ListLogEntriesRequest {
258259
// Required. Names of one or more parent resources from which to
259260
// retrieve log entries:
260261
//
261-
// "projects/[PROJECT_ID]"
262-
// "organizations/[ORGANIZATION_ID]"
263-
// "billingAccounts/[BILLING_ACCOUNT_ID]"
264-
// "folders/[FOLDER_ID]"
262+
// * `projects/[PROJECT_ID]`
263+
// * `organizations/[ORGANIZATION_ID]`
264+
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
265+
// * `folders/[FOLDER_ID]`
266+
//
267+
// May alternatively be one or more views:
265268
//
266-
// May alternatively be one or more views
267-
// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
268-
// organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
269-
// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
270-
// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
269+
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
270+
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
271+
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
272+
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
271273
//
272274
// Projects listed in the `project_ids` field are added to this list.
273275
repeated string resource_names = 8 [
@@ -294,10 +296,10 @@ message ListLogEntriesRequest {
294296
// timestamps are returned in order of their `insert_id` values.
295297
string order_by = 3 [(google.api.field_behavior) = OPTIONAL];
296298

297-
// Optional. The maximum number of results to return from this request.
298-
// Default is 50. If the value is negative or exceeds 1000,
299-
// the request is rejected. The presence of `next_page_token` in the
300-
// response indicates that more results might be available.
299+
// Optional. The maximum number of results to return from this request. Default is 50.
300+
// If the value is negative or exceeds 1000, the request is rejected. The
301+
// presence of `next_page_token` in the response indicates that more results
302+
// might be available.
301303
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
302304

303305
// Optional. If present, then retrieve the next batch of results from the
@@ -356,10 +358,10 @@ message ListMonitoredResourceDescriptorsResponse {
356358
message ListLogsRequest {
357359
// Required. The resource name that owns the logs:
358360
//
359-
// "projects/[PROJECT_ID]"
360-
// "organizations/[ORGANIZATION_ID]"
361-
// "billingAccounts/[BILLING_ACCOUNT_ID]"
362-
// "folders/[FOLDER_ID]"
361+
// * `projects/[PROJECT_ID]`
362+
// * `organizations/[ORGANIZATION_ID]`
363+
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
364+
// * `folders/[FOLDER_ID]`
363365
string parent = 1 [
364366
(google.api.field_behavior) = REQUIRED,
365367
(google.api.resource_reference) = {
@@ -379,17 +381,24 @@ message ListLogsRequest {
379381
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
380382

381383
// Optional. The resource name that owns the logs:
382-
// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
383-
// organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
384-
// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
385-
// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
384+
//
385+
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
386+
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
387+
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
388+
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
386389
//
387390
// To support legacy queries, it could also be:
388-
// "projects/[PROJECT_ID]"
389-
// "organizations/[ORGANIZATION_ID]"
390-
// "billingAccounts/[BILLING_ACCOUNT_ID]"
391-
// "folders/[FOLDER_ID]"
392-
repeated string resource_names = 8 [(google.api.field_behavior) = OPTIONAL];
391+
//
392+
// * `projects/[PROJECT_ID]`
393+
// * `organizations/[ORGANIZATION_ID]`
394+
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
395+
// * `folders/[FOLDER_ID]`
396+
repeated string resource_names = 8 [
397+
(google.api.field_behavior) = OPTIONAL,
398+
(google.api.resource_reference) = {
399+
child_type: "logging.googleapis.com/Log"
400+
}
401+
];
393402
}
394403

395404
// Result returned from ListLogs.
@@ -409,16 +418,17 @@ message ListLogsResponse {
409418
message TailLogEntriesRequest {
410419
// Required. Name of a parent resource from which to retrieve log entries:
411420
//
412-
// "projects/[PROJECT_ID]"
413-
// "organizations/[ORGANIZATION_ID]"
414-
// "billingAccounts/[BILLING_ACCOUNT_ID]"
415-
// "folders/[FOLDER_ID]"
421+
// * `projects/[PROJECT_ID]`
422+
// * `organizations/[ORGANIZATION_ID]`
423+
// * `billingAccounts/[BILLING_ACCOUNT_ID]`
424+
// * `folders/[FOLDER_ID]`
416425
//
417426
// May alternatively be one or more views:
418-
// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
419-
// "organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
420-
// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
421-
// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
427+
//
428+
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
429+
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
430+
// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
431+
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
422432
repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED];
423433

424434
// Optional. A filter that chooses which log entries to return. See [Advanced

0 commit comments

Comments
 (0)