feat: Update AppEngine RequestLog proto to add trace_sampled field. Also add a bazel build file.

The AppEngine RequestLog proto is used in Cloud Logging for request logs coming from App Engine Standard Environment. The RequestLog proto is encoded as a google.protobuf.Any message inside the protoPayload field of the LogEntry. An updated proto and bazel build file allows client libraries to decode the Any message when reading logs from the Cloud Logging API.

PiperOrigin-RevId: 319927433
This commit is contained in:
Google APIs 2020-07-06 23:23:25 -07:00 committed by Copybara-Service
parent 8c85e06916
commit 61493c4b05
2 changed files with 170 additions and 1 deletions

View File

@ -0,0 +1,165 @@
# This file was automatically generated by BuildFileGenerator
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
proto_library(
name = "logging_proto",
srcs = [
"request_log.proto",
],
deps = [
"//google/logging/type:type_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "logging_java_proto",
deps = [":logging_proto"],
)
java_grpc_library(
name = "logging_java_grpc",
srcs = [":logging_proto"],
deps = [":logging_java_proto"],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_proto_library",
)
go_proto_library(
name = "logging_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/appengine/logging/v1",
protos = [":logging_proto"],
deps = [
"//google/logging/type:type_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"moved_proto_library",
"py_grpc_library",
"py_proto_library",
)
moved_proto_library(
name = "logging_moved_proto",
srcs = [":logging_proto"],
deps = [
"//google/logging/type:type_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
py_proto_library(
name = "logging_py_proto",
plugin = "@protoc_docs_plugin//:docs_plugin",
deps = [":logging_moved_proto"],
)
py_grpc_library(
name = "logging_py_grpc",
srcs = [":logging_moved_proto"],
deps = [":logging_py_proto"],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "logging_php_proto",
deps = [":logging_proto"],
)
php_grpc_library(
name = "logging_php_grpc",
srcs = [":logging_proto"],
deps = [":logging_php_proto"],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "logging_ruby_proto",
deps = [":logging_proto"],
)
ruby_grpc_library(
name = "logging_ruby_grpc",
srcs = [":logging_proto"],
deps = [":logging_ruby_proto"],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "logging_csharp_proto",
deps = [":logging_proto"],
)
csharp_grpc_library(
name = "logging_csharp_grpc",
srcs = [":logging_proto"],
deps = [":logging_csharp_proto"],
)
##############################################################################
# C++
##############################################################################
# Put your C++ code here

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -182,6 +182,10 @@ message RequestLog {
// Stackdriver Trace identifier for this request.
string trace_id = 39;
// If true, the value in the 'trace_id' field was sampled for storage in a
// trace backend.
bool trace_sampled = 43;
// Source code for the application that handled this request. There can be
// more than one source reference per deployed application if source code is
// distributed among multiple repositories.