Skip to content

Commit acd5f89

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update Logging API with latest changes
PiperOrigin-RevId: 429289471
1 parent f30b83d commit acd5f89

8 files changed

Lines changed: 752 additions & 281 deletions

File tree

google/logging/type/http_request.proto

Lines changed: 2 additions & 2 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,8 +16,8 @@ syntax = "proto3";
1616

1717
package google.logging.type;
1818

19-
import "google/protobuf/duration.proto";
2019
import "google/api/annotations.proto";
20+
import "google/protobuf/duration.proto";
2121

2222
option csharp_namespace = "Google.Cloud.Logging.Type";
2323
option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype";

google/logging/type/log_severity.proto

Lines changed: 2 additions & 1 deletion
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.
@@ -23,6 +23,7 @@ option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype";
2323
option java_multiple_files = true;
2424
option java_outer_classname = "LogSeverityProto";
2525
option java_package = "com.google.logging.type";
26+
option objc_class_prefix = "GLOG";
2627
option php_namespace = "Google\\Cloud\\Logging\\Type";
2728
option ruby_package = "Google::Cloud::Logging::Type";
2829

google/logging/v2/BUILD.bazel

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -35,6 +35,7 @@ proto_library(
3535
"//google/api:monitored_resource_proto",
3636
"//google/api:resource_proto",
3737
"//google/logging/type:type_proto",
38+
"//google/longrunning:operations_proto",
3839
"//google/rpc:status_proto",
3940
"@com_google_protobuf//:any_proto",
4041
"@com_google_protobuf//:duration_proto",
@@ -81,6 +82,7 @@ java_gapic_library(
8182
srcs = [":logging_proto_with_info"],
8283
gapic_yaml = "logging_gapic.yaml",
8384
grpc_service_config = "logging_grpc_service_config.json",
85+
service_yaml = "logging.yaml",
8486
test_deps = [
8587
":logging_java_grpc",
8688
],
@@ -133,6 +135,7 @@ go_proto_library(
133135
"//google/api:metric_go_proto",
134136
"//google/api:monitoredres_go_proto",
135137
"//google/logging/type:type_go_proto",
138+
"//google/longrunning:longrunning_go_proto",
136139
"//google/rpc:status_go_proto",
137140
],
138141
)
@@ -142,11 +145,18 @@ go_gapic_library(
142145
srcs = [":logging_proto_with_info"],
143146
grpc_service_config = "logging_grpc_service_config.json",
144147
importpath = "cloud.google.com/go/logging/apiv2;logging",
148+
metadata = True,
145149
service_yaml = "logging.yaml",
146150
deps = [
147151
":logging_go_proto",
152+
"//google/api:metric_go_proto",
148153
"//google/api:monitoredres_go_proto",
154+
"//google/longrunning:longrunning_go_proto",
155+
"@com_google_cloud_go//longrunning:go_default_library",
156+
"@com_google_cloud_go//longrunning/autogen:go_default_library",
157+
"@io_bazel_rules_go//proto/wkt:any_go_proto",
149158
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
159+
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
150160
],
151161
)
152162

@@ -162,6 +172,7 @@ go_gapic_assembly_pkg(
162172
name = "gapi-cloud-logging-v2-go",
163173
deps = [
164174
":logging_go_gapic",
175+
":logging_go_gapic_srcjar-metadata.srcjar",
165176
":logging_go_gapic_srcjar-test.srcjar",
166177
":logging_go_proto",
167178
],
@@ -181,8 +192,8 @@ py_gapic_library(
181192
srcs = [":logging_proto"],
182193
grpc_service_config = "logging_grpc_service_config.json",
183194
opt_args = [
184-
"python-gapic-namespace=google.cloud",
185195
"python-gapic-name=logging",
196+
"python-gapic-namespace=google.cloud",
186197
],
187198
)
188199

@@ -293,11 +304,11 @@ ruby_cloud_gapic_library(
293304
name = "logging_ruby_gapic",
294305
srcs = [":logging_proto_with_info"],
295306
extra_protoc_parameters = [
296-
"ruby-cloud-gem-name=google-cloud-logging-v2",
297-
"ruby-cloud-env-prefix=LOGGING",
298-
"ruby-cloud-product-url=https://cloud.google.com/logging",
299307
"ruby-cloud-api-id=logging.googleapis.com",
300308
"ruby-cloud-api-shortname=logging",
309+
"ruby-cloud-env-prefix=LOGGING",
310+
"ruby-cloud-gem-name=google-cloud-logging-v2",
311+
"ruby-cloud-product-url=https://cloud.google.com/logging",
301312
"ruby-cloud-service-override=ConfigServiceV2=ConfigService;LoggingServiceV2=LoggingService;MetricsServiceV2=MetricsService",
302313
"ruby-cloud-yard-strict=false",
303314
],

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+
}

0 commit comments

Comments
 (0)