feat: Log Analytics features of the Cloud Logging API

feat: Add ConfigServiceV2.CreateBucketAsync method for creating Log Buckets asynchronously
feat: Add ConfigServiceV2.UpdateBucketAsync method for creating Log Buckets asynchronously
feat: Add ConfigServiceV2.CreateLink method for creating linked datasets for Log Analytics Buckets
feat: Add ConfigServiceV2.DeleteLink method for deleting linked datasets
feat: Add ConfigServiceV2.ListLinks method for listing linked datasets
feat: Add ConfigServiceV2.GetLink methods for describing linked datasets
feat: Add LogBucket.analytics_enabled field that specifies whether Log Bucket's Analytics features are enabled
feat: Add LogBucket.index_configs field that contains a list of Log Bucket's indexed fields and related configuration data
docs: Documentation for the Log Analytics features of the Cloud Logging API

PiperOrigin-RevId: 529851525
pull/802/head
Google APIs 2 years ago committed by Copybara-Service
parent 279cb5a598
commit 1c7ee99d19
  1. 18
      google/logging/type/BUILD.bazel
  2. 4
      google/logging/type/http_request.proto
  3. 2
      google/logging/type/log_severity.proto
  4. 145
      google/logging/v2/BUILD.bazel
  5. 99
      google/logging/v2/log_entry.proto
  6. 128
      google/logging/v2/logging.proto
  7. 788
      google/logging/v2/logging_config.proto
  8. 33
      google/logging/v2/logging_metrics.proto
  9. 23
      google/logging/v2/logging_v2.yaml

@ -15,7 +15,6 @@ proto_library(
"log_severity.proto", "log_severity.proto",
], ],
deps = [ deps = [
"//google/api:annotations_proto",
"@com_google_protobuf//:duration_proto", "@com_google_protobuf//:duration_proto",
], ],
) )
@ -60,6 +59,7 @@ java_gapic_assembly_gradle_pkg(
load( load(
"@com_google_googleapis_imports//:imports.bzl", "@com_google_googleapis_imports//:imports.bzl",
"go_proto_library", "go_proto_library",
"go_gapic_assembly_pkg",
) )
go_proto_library( go_proto_library(
@ -68,7 +68,13 @@ go_proto_library(
importpath = "google.golang.org/genproto/googleapis/logging/type", importpath = "google.golang.org/genproto/googleapis/logging/type",
protos = [":type_proto"], protos = [":type_proto"],
deps = [ deps = [
"//google/api:annotations_go_proto", ],
)
go_gapic_assembly_pkg(
name = "logging-type-go",
deps = [
":type_go_proto",
], ],
) )
@ -86,7 +92,6 @@ moved_proto_library(
name = "type_moved_proto", name = "type_moved_proto",
srcs = [":type_proto"], srcs = [":type_proto"],
deps = [ deps = [
"//google/api:annotations_proto",
"@com_google_protobuf//:duration_proto", "@com_google_protobuf//:duration_proto",
], ],
) )
@ -107,9 +112,9 @@ py_grpc_library(
############################################################################## ##############################################################################
load( load(
"@com_google_googleapis_imports//:imports.bzl", "@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_grpc_library", "php_grpc_library",
"php_proto_library", "php_proto_library",
"php_gapic_assembly_pkg",
) )
php_proto_library( php_proto_library(
@ -128,7 +133,9 @@ php_grpc_library(
# Open Source Packages # Open Source Packages
php_gapic_assembly_pkg( php_gapic_assembly_pkg(
name = "google-logging-type-php", name = "google-logging-type-php",
deps = [":type_php_proto"], deps = [
":type_php_proto",
],
) )
############################################################################## ##############################################################################
@ -140,6 +147,7 @@ load(
"nodejs_gapic_library", "nodejs_gapic_library",
) )
############################################################################## ##############################################################################
# Ruby # Ruby
############################################################################## ##############################################################################

@ -1,4 +1,4 @@
// Copyright 2022 Google LLC // Copyright 2023 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -67,7 +67,7 @@ message HttpRequest {
// The referer URL of the request, as defined in // The referer URL of the request, as defined in
// [HTTP/1.1 Header Field // [HTTP/1.1 Header Field
// Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). // Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
string referer = 8; string referer = 8;
// The request processing latency on the server, from the time the request was // The request processing latency on the server, from the time the request was

@ -1,4 +1,4 @@
// Copyright 2022 Google LLC // Copyright 2023 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.

@ -9,44 +9,14 @@
# * extra_protoc_file_parameters # * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code. # The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
############################################################################## ##############################################################################
# Common # Common
############################################################################## ##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_proto//proto:defs.bzl", "proto_library")
load( load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
"proto_library_with_info",
"py_gapic_assembly_pkg",
"py_gapic_library",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
proto_library( proto_library(
name = "logging_proto", name = "logging_proto",
@ -84,6 +54,18 @@ proto_library_with_info(
], ],
) )
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library( java_proto_library(
name = "logging_java_proto", name = "logging_java_proto",
deps = [":logging_proto"], deps = [":logging_proto"],
@ -135,6 +117,17 @@ java_gapic_assembly_gradle_pkg(
], ],
) )
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library( go_proto_library(
name = "logging_go_proto", name = "logging_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"], compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@ -156,8 +149,8 @@ go_gapic_library(
srcs = [":logging_proto_with_info"], srcs = [":logging_proto_with_info"],
grpc_service_config = "logging_grpc_service_config.json", grpc_service_config = "logging_grpc_service_config.json",
importpath = "cloud.google.com/go/logging/apiv2;logging", importpath = "cloud.google.com/go/logging/apiv2;logging",
release_level = "ga",
metadata = True, metadata = True,
release_level = "ga",
rest_numeric_enums = True, rest_numeric_enums = True,
service_yaml = "logging_v2.yaml", service_yaml = "logging_v2.yaml",
transport = "grpc", transport = "grpc",
@ -193,6 +186,16 @@ go_gapic_assembly_pkg(
], ],
) )
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
)
py_gapic_library( py_gapic_library(
name = "logging_py_gapic", name = "logging_py_gapic",
srcs = [":logging_proto"], srcs = [":logging_proto"],
@ -204,18 +207,19 @@ py_gapic_library(
rest_numeric_enums = True, rest_numeric_enums = True,
service_yaml = "logging_v2.yaml", service_yaml = "logging_v2.yaml",
transport = "grpc", transport = "grpc",
deps = [
],
) )
# Uncomment once https://github.com/googleapis/gapic-generator-python/issues/1359 is fixed py_test(
#py_test( name = "logging_py_gapic_test",
# name = "logging_py_gapic_test", srcs = [
# srcs = [ "logging_py_gapic_pytest.py",
# "logging_py_gapic_pytest.py", "logging_py_gapic_test.py",
# "logging_py_gapic_test.py", ],
# ], legacy_create_init = False,
# legacy_create_init = False, deps = [":logging_py_gapic"],
# deps = [":logging_py_gapic"], )
#)
# Open Source Packages # Open Source Packages
py_gapic_assembly_pkg( py_gapic_assembly_pkg(
@ -225,6 +229,17 @@ py_gapic_assembly_pkg(
], ],
) )
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library( php_proto_library(
name = "logging_php_proto", name = "logging_php_proto",
deps = [":logging_proto"], deps = [":logging_proto"],
@ -260,6 +275,15 @@ php_gapic_assembly_pkg(
], ],
) )
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library( nodejs_gapic_library(
name = "logging_nodejs_gapic", name = "logging_nodejs_gapic",
package_name = "@google-cloud/logging", package_name = "@google-cloud/logging",
@ -283,6 +307,17 @@ nodejs_gapic_assembly_pkg(
], ],
) )
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library( ruby_proto_library(
name = "logging_ruby_proto", name = "logging_ruby_proto",
deps = [":logging_proto"], deps = [":logging_proto"],
@ -328,6 +363,17 @@ ruby_gapic_assembly_pkg(
], ],
) )
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library( csharp_proto_library(
name = "logging_csharp_proto", name = "logging_csharp_proto",
deps = [":logging_proto"], deps = [":logging_proto"],
@ -363,6 +409,15 @@ csharp_gapic_assembly_pkg(
], ],
) )
##############################################################################
# C++
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)
cc_proto_library( cc_proto_library(
name = "logging_cc_proto", name = "logging_cc_proto",
deps = [":logging_proto"], deps = [":logging_proto"],

@ -1,4 +1,4 @@
// Copyright 2022 Google LLC // Copyright 2023 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -75,7 +75,8 @@ message LogEntry {
// Example: a log entry that reports a database error would be associated with // Example: a log entry that reports a database error would be associated with
// the monitored resource designating the particular database that reported // the monitored resource designating the particular database that reported
// the error. // the error.
google.api.MonitoredResource resource = 8 [(google.api.field_behavior) = REQUIRED]; google.api.MonitoredResource resource = 8
[(google.api.field_behavior) = REQUIRED];
// The log entry payload, which can be one of multiple types. // The log entry payload, which can be one of multiple types.
oneof payload { oneof payload {
@ -97,27 +98,32 @@ message LogEntry {
google.protobuf.Struct json_payload = 6; google.protobuf.Struct json_payload = 6;
} }
// Optional. The time the event described by the log entry occurred. This time is used // Optional. The time the event described by the log entry occurred. This time
// to compute the log entry's age and to enforce the logs retention period. // is used to compute the log entry's age and to enforce the logs retention
// If this field is omitted in a new log entry, then Logging assigns it the // period. If this field is omitted in a new log entry, then Logging assigns
// current time. Timestamps have nanosecond accuracy, but trailing zeros in // it the current time. Timestamps have nanosecond accuracy, but trailing
// the fractional seconds might be omitted when the timestamp is displayed. // zeros in the fractional seconds might be omitted when the timestamp is
// displayed.
// //
// Incoming log entries must have timestamps that don't exceed the // Incoming log entries must have timestamps that don't exceed the
// [logs retention // [logs retention
// period](https://cloud.google.com/logging/quotas#logs_retention_periods) in // period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
// the past, and that don't exceed 24 hours in the future. Log entries outside // the past, and that don't exceed 24 hours in the future. Log entries outside
// those time boundaries aren't ingested by Logging. // those time boundaries aren't ingested by Logging.
google.protobuf.Timestamp timestamp = 9 [(google.api.field_behavior) = OPTIONAL]; google.protobuf.Timestamp timestamp = 9
[(google.api.field_behavior) = OPTIONAL];
// Output only. The time the log entry was received by Logging. // Output only. The time the log entry was received by Logging.
google.protobuf.Timestamp receive_timestamp = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; google.protobuf.Timestamp receive_timestamp = 24
[(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. // Optional. The severity of the log entry. The default value is
google.logging.type.LogSeverity severity = 10 [(google.api.field_behavior) = OPTIONAL]; // `LogSeverity.DEFAULT`.
google.logging.type.LogSeverity severity = 10
[(google.api.field_behavior) = OPTIONAL];
// Optional. A unique identifier for the log entry. If you provide a value, then // Optional. A unique identifier for the log entry. If you provide a value,
// Logging considers other log entries in the same project, with the same // then Logging considers other log entries in the same project, with the same
// `timestamp`, and with the same `insert_id` to be duplicates which are // `timestamp`, and with the same `insert_id` to be duplicates which are
// removed in a single query result. However, there are no guarantees of // removed in a single query result. However, there are no guarantees of
// de-duplication in the export of logs. // de-duplication in the export of logs.
@ -129,12 +135,13 @@ message LogEntry {
// the same `log_name` and `timestamp` values. // the same `log_name` and `timestamp` values.
string insert_id = 4 [(google.api.field_behavior) = OPTIONAL]; string insert_id = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. Information about the HTTP request associated with this log entry, if // Optional. Information about the HTTP request associated with this log
// applicable. // entry, if applicable.
google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior) = OPTIONAL]; google.logging.type.HttpRequest http_request = 7
[(google.api.field_behavior) = OPTIONAL];
// Optional. A map of key, value pairs that provides additional information about the // Optional. A map of key, value pairs that provides additional information
// log entry. The labels can be user-defined or system-defined. // about the log entry. The labels can be user-defined or system-defined.
// //
// User-defined labels are arbitrary key, value pairs that you can use to // User-defined labels are arbitrary key, value pairs that you can use to
// classify logs. // classify logs.
@ -153,17 +160,47 @@ message LogEntry {
// applicable. // applicable.
LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL]; LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL];
// Optional. Resource name of the trace associated with the log entry, if any. If it // Optional. The REST resource name of the trace being written to
// contains a relative resource name, the name is assumed to be relative to // [Cloud Trace](https://cloud.google.com/trace) in
// `//tracing.googleapis.com`. Example: // association with this log entry. For example, if your trace data is stored
// `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` // in the Cloud project "my-trace-project" and if the service that is creating
// the log entry receives a trace header that includes the trace ID "12345",
// then the service should use "projects/my-tracing-project/traces/12345".
//
// The `trace` field provides the link between logs and traces. By using
// this field, you can navigate from a log entry to a trace.
string trace = 22 [(google.api.field_behavior) = OPTIONAL]; string trace = 22 [(google.api.field_behavior) = OPTIONAL];
// Optional. The span ID within the trace associated with the log entry. // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
// associated with the current operation in which the log is being written.
// For example, if a span has the REST resource name of
// "projects/some-project/traces/some-trace/spans/some-span-id", then the
// `span_id` field is "some-span-id".
//
// A
// [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
// represents a single operation within a trace. Whereas a trace may involve
// multiple different microservices running on multiple different machines,
// a span generally corresponds to a single logical operation being performed
// in a single instance of a microservice on one specific machine. Spans
// are the nodes within the tree that is a trace.
//
// Applications that are [instrumented for
// tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
// new, unique span ID on each incoming request. It is also common to create
// and record additional spans corresponding to internal processing elements
// as well as issuing requests to dependencies.
//
// The span ID is expected to be a 16-character, hexadecimal encoding of an
// 8-byte array and should not be zero. It should be unique within the trace
// and should, ideally, be generated in a manner that is uniformly random.
//
// Example values:
// //
// For Trace spans, this is the same format that the Trace API v2 uses: a // - `000000000000004a`
// 16-character hexadecimal encoding of an 8-byte array, such as // - `7a2190356c3fc94b`
// `000000000000004a`. // - `0000f00300090021`
// - `d39223e101960076`
string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; string span_id = 27 [(google.api.field_behavior) = OPTIONAL];
// Optional. The sampling decision of the trace associated with the log entry. // Optional. The sampling decision of the trace associated with the log entry.
@ -175,11 +212,13 @@ message LogEntry {
// request correlation identifier. The default is False. // request correlation identifier. The default is False.
bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL]; bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL];
// Optional. Source code location information associated with the log entry, if any. // Optional. Source code location information associated with the log entry,
LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL]; // if any.
LogEntrySourceLocation source_location = 23
[(google.api.field_behavior) = OPTIONAL];
// Optional. Information indicating this LogEntry is part of a sequence of multiple log // Optional. Information indicating this LogEntry is part of a sequence of
// entries split from a single LogEntry. // multiple log entries split from a single LogEntry.
LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL]; LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL];
} }

@ -1,4 +1,4 @@
// Copyright 2022 Google LLC // Copyright 2023 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -52,18 +52,10 @@ service LoggingServiceV2 {
rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) {
option (google.api.http) = { option (google.api.http) = {
delete: "/v2/{log_name=projects/*/logs/*}" delete: "/v2/{log_name=projects/*/logs/*}"
additional_bindings { additional_bindings { delete: "/v2/{log_name=*/*/logs/*}" }
delete: "/v2/{log_name=*/*/logs/*}" additional_bindings { delete: "/v2/{log_name=organizations/*/logs/*}" }
} additional_bindings { delete: "/v2/{log_name=folders/*/logs/*}" }
additional_bindings { additional_bindings { delete: "/v2/{log_name=billingAccounts/*/logs/*}" }
delete: "/v2/{log_name=organizations/*/logs/*}"
}
additional_bindings {
delete: "/v2/{log_name=folders/*/logs/*}"
}
additional_bindings {
delete: "/v2/{log_name=billingAccounts/*/logs/*}"
}
}; };
option (google.api.method_signature) = "log_name"; option (google.api.method_signature) = "log_name";
} }
@ -75,7 +67,8 @@ service LoggingServiceV2 {
// A single request may contain log entries for a maximum of 1000 // A single request may contain log entries for a maximum of 1000
// different resources (projects, organizations, billing accounts or // different resources (projects, organizations, billing accounts or
// folders) // folders)
rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) { rpc WriteLogEntries(WriteLogEntriesRequest)
returns (WriteLogEntriesResponse) {
option (google.api.http) = { option (google.api.http) = {
post: "/v2/entries:write" post: "/v2/entries:write"
body: "*" body: "*"
@ -96,7 +89,8 @@ service LoggingServiceV2 {
} }
// Lists the descriptors for monitored resource types used by Logging. // Lists the descriptors for monitored resource types used by Logging.
rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) { rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest)
returns (ListMonitoredResourceDescriptorsResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/v2/monitoredResourceDescriptors" get: "/v2/monitoredResourceDescriptors"
}; };
@ -107,17 +101,21 @@ service LoggingServiceV2 {
rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) { rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/v2/{parent=*/*}/logs" get: "/v2/{parent=*/*}/logs"
additional_bindings { get: "/v2/{parent=projects/*}/logs" }
additional_bindings { get: "/v2/{parent=organizations/*}/logs" }
additional_bindings { get: "/v2/{parent=folders/*}/logs" }
additional_bindings { get: "/v2/{parent=billingAccounts/*}/logs" }
additional_bindings { additional_bindings {
get: "/v2/{parent=projects/*}/logs" get: "/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs"
} }
additional_bindings { additional_bindings {
get: "/v2/{parent=organizations/*}/logs" get: "/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs"
} }
additional_bindings { additional_bindings {
get: "/v2/{parent=folders/*}/logs" get: "/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs"
} }
additional_bindings { additional_bindings {
get: "/v2/{parent=billingAccounts/*}/logs" get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs"
} }
}; };
option (google.api.method_signature) = "parent"; option (google.api.method_signature) = "parent";
@ -125,7 +123,8 @@ service LoggingServiceV2 {
// Streaming read of log entries as they are ingested. Until the stream is // Streaming read of log entries as they are ingested. Until the stream is
// terminated, it will continue reading logs. // terminated, it will continue reading logs.
rpc TailLogEntries(stream TailLogEntriesRequest) returns (stream TailLogEntriesResponse) { rpc TailLogEntries(stream TailLogEntriesRequest)
returns (stream TailLogEntriesResponse) {
option (google.api.http) = { option (google.api.http) = {
post: "/v2/entries:tail" post: "/v2/entries:tail"
body: "*" body: "*"
@ -150,9 +149,7 @@ message DeleteLogRequest {
// [LogEntry][google.logging.v2.LogEntry]. // [LogEntry][google.logging.v2.LogEntry].
string log_name = 1 [ string log_name = 1 [
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { (google.api.resource_reference) = { type: "logging.googleapis.com/Log" }
type: "logging.googleapis.com/Log"
}
]; ];
} }
@ -177,9 +174,7 @@ message WriteLogEntriesRequest {
// individual log entry. // individual log entry.
string log_name = 1 [ string log_name = 1 [
(google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = { (google.api.resource_reference) = { type: "logging.googleapis.com/Log" }
type: "logging.googleapis.com/Log"
}
]; ];
// Optional. A default monitored resource object that is assigned to all log // Optional. A default monitored resource object that is assigned to all log
@ -190,7 +185,8 @@ message WriteLogEntriesRequest {
// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} // "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
// //
// See [LogEntry][google.logging.v2.LogEntry]. // See [LogEntry][google.logging.v2.LogEntry].
google.api.MonitoredResource resource = 2 [(google.api.field_behavior) = OPTIONAL]; google.api.MonitoredResource resource = 2
[(google.api.field_behavior) = OPTIONAL];
// Optional. Default labels that are added to the `labels` field of all log // Optional. Default labels that are added to the `labels` field of all log
// entries in `entries`. If a log entry already has a label with the same key // entries in `entries`. If a log entry already has a label with the same key
@ -224,11 +220,13 @@ message WriteLogEntriesRequest {
// list, rather than calling this method for each individual log entry. // list, rather than calling this method for each individual log entry.
repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED]; repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED];
// Optional. Whether valid entries should be written even if some other // Optional. Whether a batch's valid entries should be written even if some
// entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any // other entry failed due to a permanent error such as INVALID_ARGUMENT or
// entry is not written, then the response status is the error associated // PERMISSION_DENIED. If any entry failed, then the response status is the
// with one of the failed entries and the response includes error details // response status of one of the failed entries. The response will include
// keyed by the entries' zero-based index in the `entries.write` method. // error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
// the entries' zero-based index in the `entries`. Failed requests for which
// no entries are written will not include per-entry errors.
bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. If true, the request should expect normal response, but the // Optional. If true, the request should expect normal response, but the
@ -238,9 +236,7 @@ message WriteLogEntriesRequest {
} }
// Result returned from WriteLogEntries. // Result returned from WriteLogEntries.
message WriteLogEntriesResponse { message WriteLogEntriesResponse {}
}
// Error details for WriteLogEntries with partial success. // Error details for WriteLogEntries with partial success.
message WriteLogEntriesPartialErrors { message WriteLogEntriesPartialErrors {
@ -271,6 +267,7 @@ message ListLogEntriesRequest {
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// //
// Projects listed in the `project_ids` field are added to this list. // Projects listed in the `project_ids` field are added to this list.
// A maximum of 100 resources may be specified in a single request.
repeated string resource_names = 8 [ repeated string resource_names = 8 [
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { (google.api.resource_reference) = {
@ -278,13 +275,11 @@ message ListLogEntriesRequest {
} }
]; ];
// Optional. A filter that chooses which log entries to return. See [Advanced // Optional. Only log entries that match the filter are returned. An empty
// Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). // filter matches all log entries in the resources listed in `resource_names`.
// Only log entries that match the filter are returned. An empty filter
// matches all log entries in the resources listed in `resource_names`.
// Referencing a parent resource that is not listed in `resource_names` will // Referencing a parent resource that is not listed in `resource_names` will
// cause the filter to return no results. The maximum length of the filter is // cause the filter to return no results. The maximum length of a filter is
// 20000 characters. // 20,000 characters.
string filter = 2 [(google.api.field_behavior) = OPTIONAL]; string filter = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. How the results should be sorted. Presently, the only permitted // Optional. How the results should be sorted. Presently, the only permitted
@ -295,10 +290,10 @@ message ListLogEntriesRequest {
// timestamps are returned in order of their `insert_id` values. // timestamps are returned in order of their `insert_id` values.
string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; string order_by = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The maximum number of results to return from this request. Default is 50. // Optional. The maximum number of results to return from this request.
// If the value is negative or exceeds 1000, the request is rejected. The // Default is 50. If the value is negative or exceeds 1000, the request is
// presence of `next_page_token` in the response indicates that more results // rejected. The presence of `next_page_token` in the response indicates that
// might be available. // more results might be available.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. If present, then retrieve the next batch of results from the // Optional. If present, then retrieve the next batch of results from the
@ -355,7 +350,7 @@ message ListMonitoredResourceDescriptorsResponse {
// The parameters to ListLogs. // The parameters to ListLogs.
message ListLogsRequest { message ListLogsRequest {
// Required. The resource name that owns the logs: // Required. The resource name to list logs for:
// //
// * `projects/[PROJECT_ID]` // * `projects/[PROJECT_ID]`
// * `organizations/[ORGANIZATION_ID]` // * `organizations/[ORGANIZATION_ID]`
@ -368,18 +363,7 @@ message ListLogsRequest {
} }
]; ];
// Optional. The maximum number of results to return from this request. // Optional. List of resource names to list logs for:
// Non-positive values are ignored. The presence of `nextPageToken` in the
// response indicates that more results might be available.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. If present, then retrieve the next batch of results from the
// preceding call to this method. `pageToken` must be the value of
// `nextPageToken` from the previous response. The values of other method
// parameters should be identical to those in the previous call.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
// Optional. The resource name that owns the logs:
// //
// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
@ -392,12 +376,25 @@ message ListLogsRequest {
// * `organizations/[ORGANIZATION_ID]` // * `organizations/[ORGANIZATION_ID]`
// * `billingAccounts/[BILLING_ACCOUNT_ID]` // * `billingAccounts/[BILLING_ACCOUNT_ID]`
// * `folders/[FOLDER_ID]` // * `folders/[FOLDER_ID]`
//
// The resource name in the `parent` field is added to this list.
repeated string resource_names = 8 [ repeated string resource_names = 8 [
(google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = { (google.api.resource_reference) = {
child_type: "logging.googleapis.com/Log" child_type: "logging.googleapis.com/Log"
} }
]; ];
// Optional. The maximum number of results to return from this request.
// Non-positive values are ignored. The presence of `nextPageToken` in the
// response indicates that more results might be available.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. If present, then retrieve the next batch of results from the
// preceding call to this method. `pageToken` must be the value of
// `nextPageToken` from the previous response. The values of other method
// parameters should be identical to those in the previous call.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
} }
// Result returned from ListLogs. // Result returned from ListLogs.
@ -430,20 +427,19 @@ message TailLogEntriesRequest {
// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED]; repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. A filter that chooses which log entries to return. See [Advanced // Optional. Only log entries that match the filter are returned. An empty
// Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). // filter matches all log entries in the resources listed in `resource_names`.
// Only log entries that match the filter are returned. An empty filter // Referencing a parent resource that is not listed in `resource_names` will
// matches all log entries in the resources listed in `resource_names`. // cause the filter to return no results. The maximum length of a filter is
// Referencing a parent resource that is not in `resource_names` will cause // 20,000 characters.
// the filter to return no results. The maximum length of the filter is 20000
// characters.
string filter = 2 [(google.api.field_behavior) = OPTIONAL]; string filter = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. The amount of time to buffer log entries at the server before // Optional. The amount of time to buffer log entries at the server before
// being returned to prevent out of order results due to late arriving log // being returned to prevent out of order results due to late arriving log
// entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 // entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
// milliseconds. // milliseconds.
google.protobuf.Duration buffer_window = 3 [(google.api.field_behavior) = OPTIONAL]; google.protobuf.Duration buffer_window = 3
[(google.api.field_behavior) = OPTIONAL];
} }
// Result returned from `TailLogEntries`. // Result returned from `TailLogEntries`.

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
// Copyright 2022 Google LLC // Copyright 2023 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -137,6 +137,17 @@ message LogMetric {
// The maximum length of the filter is 20000 characters. // The maximum length of the filter is 20000 characters.
string filter = 3 [(google.api.field_behavior) = REQUIRED]; string filter = 3 [(google.api.field_behavior) = REQUIRED];
// Optional. The resource name of the Log Bucket that owns the Log Metric.
// Only Log Buckets in projects are supported. The bucket has to be in the
// same project as the metric.
//
// For example:
//
// `projects/my-project/locations/global/buckets/my-bucket`
//
// If empty, then the Log Metric is considered a non-Bucket Log Metric.
string bucket_name = 13 [(google.api.field_behavior) = OPTIONAL];
// Optional. If set to True, then this metric is disabled and it does not // Optional. If set to True, then this metric is disabled and it does not
// generate any points. // generate any points.
bool disabled = 12 [(google.api.field_behavior) = OPTIONAL]; bool disabled = 12 [(google.api.field_behavior) = OPTIONAL];
@ -162,12 +173,14 @@ message LogMetric {
// be updated once initially configured. New labels can be added in the // be updated once initially configured. New labels can be added in the
// `metric_descriptor`, but existing labels cannot be modified except for // `metric_descriptor`, but existing labels cannot be modified except for
// their description. // their description.
google.api.MetricDescriptor metric_descriptor = 5 [(google.api.field_behavior) = OPTIONAL]; google.api.MetricDescriptor metric_descriptor = 5
[(google.api.field_behavior) = OPTIONAL];
// Optional. A `value_extractor` is required when using a distribution // Optional. A `value_extractor` is required when using a distribution
// logs-based metric to extract the values to record from a log entry. // logs-based metric to extract the values to record from a log entry.
// Two functions are supported for value extraction: `EXTRACT(field)` or // Two functions are supported for value extraction: `EXTRACT(field)` or
// `REGEXP_EXTRACT(field, regex)`. The argument are: // `REGEXP_EXTRACT(field, regex)`. The arguments are:
//
// 1. field: The name of the log entry field from which the value is to be // 1. field: The name of the log entry field from which the value is to be
// extracted. // extracted.
// 2. regex: A regular expression using the Google RE2 syntax // 2. regex: A regular expression using the Google RE2 syntax
@ -192,29 +205,33 @@ message LogMetric {
// is the same as for the `value_extractor` field. // is the same as for the `value_extractor` field.
// //
// The extracted value is converted to the type defined in the label // The extracted value is converted to the type defined in the label
// descriptor. If the either the extraction or the type conversion fails, // descriptor. If either the extraction or the type conversion fails,
// the label will have a default value. The default value for a string // the label will have a default value. The default value for a string
// label is an empty string, for an integer label its 0, and for a boolean // label is an empty string, for an integer label its 0, and for a boolean
// label its `false`. // label its `false`.
// //
// Note that there are upper bounds on the maximum number of labels and the // Note that there are upper bounds on the maximum number of labels and the
// number of active time series that are allowed in a project. // number of active time series that are allowed in a project.
map<string, string> label_extractors = 7 [(google.api.field_behavior) = OPTIONAL]; map<string, string> label_extractors = 7
[(google.api.field_behavior) = OPTIONAL];
// Optional. The `bucket_options` are required when the logs-based metric is // Optional. The `bucket_options` are required when the logs-based metric is
// using a DISTRIBUTION value type and it describes the bucket boundaries // using a DISTRIBUTION value type and it describes the bucket boundaries
// used to create a histogram of the extracted values. // used to create a histogram of the extracted values.
google.api.Distribution.BucketOptions bucket_options = 8 [(google.api.field_behavior) = OPTIONAL]; google.api.Distribution.BucketOptions bucket_options = 8
[(google.api.field_behavior) = OPTIONAL];
// Output only. The creation timestamp of the metric. // Output only. The creation timestamp of the metric.
// //
// This field may not be present for older metrics. // This field may not be present for older metrics.
google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; google.protobuf.Timestamp create_time = 9
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last update timestamp of the metric. // Output only. The last update timestamp of the metric.
// //
// This field may not be present for older metrics. // This field may not be present for older metrics.
google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; google.protobuf.Timestamp update_time = 10
[(google.api.field_behavior) = OUTPUT_ONLY];
// Deprecated. The API version that created or updated this metric. // Deprecated. The API version that created or updated this metric.
// The v2 format is used by default and cannot be changed. // The v2 format is used by default and cannot be changed.

@ -7,10 +7,14 @@ apis:
- name: google.logging.v2.ConfigServiceV2 - name: google.logging.v2.ConfigServiceV2
- name: google.logging.v2.LoggingServiceV2 - name: google.logging.v2.LoggingServiceV2
- name: google.logging.v2.MetricsServiceV2 - name: google.logging.v2.MetricsServiceV2
- name: google.longrunning.Operations
types: types:
- name: google.logging.v2.BucketMetadata
- name: google.logging.v2.CopyLogEntriesMetadata - name: google.logging.v2.CopyLogEntriesMetadata
- name: google.logging.v2.CopyLogEntriesResponse - name: google.logging.v2.CopyLogEntriesResponse
- name: google.logging.v2.LinkMetadata
- name: google.logging.v2.LocationMetadata
documentation: documentation:
summary: Writes log entries and manages your Cloud Logging configuration. summary: Writes log entries and manages your Cloud Logging configuration.
@ -58,7 +62,7 @@ http:
- get: '/v2/{name=projects/*/locations/*/operations/*}' - get: '/v2/{name=projects/*/locations/*/operations/*}'
- get: '/v2/{name=organizations/*/locations/*/operations/*}' - get: '/v2/{name=organizations/*/locations/*/operations/*}'
- get: '/v2/{name=folders/*/locations/*/operations/*}' - get: '/v2/{name=folders/*/locations/*/operations/*}'
- get: '/v2/{name=billingAccounts/*/operations/*}' - get: '/v2/{name=billingAccounts/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.ListOperations - selector: google.longrunning.Operations.ListOperations
get: '/v2/{name=*/*/locations/*}/operations' get: '/v2/{name=*/*/locations/*}/operations'
additional_bindings: additional_bindings:
@ -95,6 +99,13 @@ authentication:
https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.admin,
https://www.googleapis.com/auth/logging.read https://www.googleapis.com/auth/logging.read
- selector: google.logging.v2.ConfigServiceV2.GetLink
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/logging.admin,
https://www.googleapis.com/auth/logging.read
- selector: google.logging.v2.ConfigServiceV2.GetSettings - selector: google.logging.v2.ConfigServiceV2.GetSettings
oauth: oauth:
canonical_scopes: |- canonical_scopes: |-
@ -130,6 +141,13 @@ authentication:
https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.admin,
https://www.googleapis.com/auth/logging.read https://www.googleapis.com/auth/logging.read
- selector: google.logging.v2.ConfigServiceV2.ListLinks
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/logging.admin,
https://www.googleapis.com/auth/logging.read
- selector: google.logging.v2.ConfigServiceV2.ListSinks - selector: google.logging.v2.ConfigServiceV2.ListSinks
oauth: oauth:
canonical_scopes: |- canonical_scopes: |-
@ -201,3 +219,6 @@ authentication:
https://www.googleapis.com/auth/cloud-platform.read-only, https://www.googleapis.com/auth/cloud-platform.read-only,
https://www.googleapis.com/auth/logging.admin, https://www.googleapis.com/auth/logging.admin,
https://www.googleapis.com/auth/logging.read https://www.googleapis.com/auth/logging.read
publishing:
documentation_uri: https://cloud.google.com/logging/docs/

Loading…
Cancel
Save