services: sync binlog proto (#4542)

https://github.com/grpc/grpc-proto/pull/20
This commit is contained in:
zpencer 2018-06-07 10:45:55 -07:00 committed by GitHub
parent 3e4c692075
commit 181aac425f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1062 additions and 63 deletions

View File

@ -54,33 +54,38 @@ public final class BinaryLogProto {
static {
java.lang.String[] descriptorData = {
"\n\027io/grpc/binarylog.proto\022\026grpc.binarylo" +
"g.v1alpha\"\315\004\n\014GrpcLogEntry\0227\n\004type\030\001 \001(\016" +
"2).grpc.binarylog.v1alpha.GrpcLogEntry.T" +
"ype\022;\n\006logger\030\002 \001(\0162+.grpc.binarylog.v1a" +
"lpha.GrpcLogEntry.Logger\0220\n\007call_id\030\003 \001(" +
"\0132\037.grpc.binarylog.v1alpha.Uint128\0224\n\010me" +
"tadata\030\004 \001(\0132 .grpc.binarylog.v1alpha.Me" +
"tadataH\000\0222\n\007message\030\005 \001(\0132\037.grpc.binaryl" +
"og.v1alpha.MessageH\000\022*\n\004peer\030\006 \001(\0132\034.grp" +
"c.binarylog.v1alpha.Peer\022\021\n\ttruncated\030\007 " +
"\001(\010\"\252\001\n\004Type\022\020\n\014UNKNOWN_TYPE\020\000\022\031\n\025SEND_I" +
"NITIAL_METADATA\020\001\022\032\n\026SEND_TRAILING_METAD" +
"ATA\020\002\022\020\n\014SEND_MESSAGE\020\003\022\031\n\025RECV_INITIAL_" +
"METADATA\020\004\022\032\n\026RECV_TRAILING_METADATA\020\005\022\020" +
"\n\014RECV_MESSAGE\020\006\"4\n\006Logger\022\022\n\016UNKNOWN_LO" +
"GGER\020\000\022\n\n\006CLIENT\020\001\022\n\n\006SERVER\020\002B\t\n\007payloa" +
"d\"6\n\007Message\022\r\n\005flags\030\001 \001(\r\022\016\n\006length\030\002 " +
"\001(\r\022\014\n\004data\030\003 \001(\014\"@\n\010Metadata\0224\n\005entry\030\001" +
" \003(\0132%.grpc.binarylog.v1alpha.MetadataEn" +
"try\"+\n\rMetadataEntry\022\013\n\003key\030\001 \001(\014\022\r\n\005val" +
"ue\030\002 \001(\014\"\277\001\n\004Peer\0228\n\tpeer_type\030\001 \001(\0162%.g" +
"rpc.binarylog.v1alpha.Peer.PeerType\022\014\n\004p" +
"eer\030\002 \001(\014\022\017\n\007address\030\003 \001(\t\022\017\n\007ip_port\030\004 " +
"\001(\r\"M\n\010PeerType\022\024\n\020UNKNOWN_PEERTYPE\020\000\022\r\n" +
"\tPEER_IPV4\020\001\022\r\n\tPEER_IPV6\020\002\022\r\n\tPEER_UNIX" +
"\020\003\"$\n\007Uint128\022\014\n\004high\030\001 \001(\006\022\013\n\003low\030\002 \001(\006" +
"B%\n\021io.grpc.binarylogB\016BinaryLogProtoP\001b" +
"\006proto3"
"g.v1alpha\032\036google/protobuf/duration.prot" +
"o\"\364\005\n\014GrpcLogEntry\0227\n\004type\030\001 \001(\0162).grpc." +
"binarylog.v1alpha.GrpcLogEntry.Type\022;\n\006l" +
"ogger\030\002 \001(\0162+.grpc.binarylog.v1alpha.Grp" +
"cLogEntry.Logger\0220\n\007call_id\030\003 \001(\0132\037.grpc" +
".binarylog.v1alpha.Uint128\0224\n\010metadata\030\004" +
" \001(\0132 .grpc.binarylog.v1alpha.MetadataH\000" +
"\0222\n\007message\030\005 \001(\0132\037.grpc.binarylog.v1alp" +
"ha.MessageH\000\022*\n\004peer\030\006 \001(\0132\034.grpc.binary" +
"log.v1alpha.Peer\022\021\n\ttruncated\030\007 \001(\010\022\023\n\013m" +
"ethod_name\030\010 \001(\t\022\023\n\013status_code\030\t \001(\r\022\026\n" +
"\016status_message\030\n \001(\t\022\026\n\016status_details\030" +
"\013 \001(\014\022*\n\007timeout\030\014 \001(\0132\031.google.protobuf" +
".Duration\022\037\n\027sequence_id_within_call\030\r \001" +
"(\r\"\252\001\n\004Type\022\020\n\014UNKNOWN_TYPE\020\000\022\031\n\025SEND_IN" +
"ITIAL_METADATA\020\001\022\032\n\026SEND_TRAILING_METADA" +
"TA\020\002\022\020\n\014SEND_MESSAGE\020\003\022\031\n\025RECV_INITIAL_M" +
"ETADATA\020\004\022\032\n\026RECV_TRAILING_METADATA\020\005\022\020\n" +
"\014RECV_MESSAGE\020\006\"4\n\006Logger\022\022\n\016UNKNOWN_LOG" +
"GER\020\000\022\n\n\006CLIENT\020\001\022\n\n\006SERVER\020\002B\t\n\007payload" +
"\"6\n\007Message\022\r\n\005flags\030\001 \001(\r\022\016\n\006length\030\002 \001" +
"(\r\022\014\n\004data\030\003 \001(\014\"@\n\010Metadata\0224\n\005entry\030\001 " +
"\003(\0132%.grpc.binarylog.v1alpha.MetadataEnt" +
"ry\"+\n\rMetadataEntry\022\013\n\003key\030\001 \001(\014\022\r\n\005valu" +
"e\030\002 \001(\014\"\277\001\n\004Peer\0228\n\tpeer_type\030\001 \001(\0162%.gr" +
"pc.binarylog.v1alpha.Peer.PeerType\022\014\n\004pe" +
"er\030\002 \001(\014\022\017\n\007address\030\003 \001(\t\022\017\n\007ip_port\030\004 \001" +
"(\r\"M\n\010PeerType\022\024\n\020UNKNOWN_PEERTYPE\020\000\022\r\n\t" +
"PEER_IPV4\020\001\022\r\n\tPEER_IPV6\020\002\022\r\n\tPEER_UNIX\020" +
"\003\"$\n\007Uint128\022\014\n\004high\030\001 \001(\006\022\013\n\003low\030\002 \001(\006B" +
"%\n\021io.grpc.binarylogB\016BinaryLogProtoP\001b\006" +
"proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@ -93,13 +98,14 @@ public final class BinaryLogProto {
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.protobuf.DurationProto.getDescriptor(),
}, assigner);
internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_binarylog_v1alpha_GrpcLogEntry_descriptor,
new java.lang.String[] { "Type", "Logger", "CallId", "Metadata", "Message", "Peer", "Truncated", "Payload", });
new java.lang.String[] { "Type", "Logger", "CallId", "Metadata", "Message", "Peer", "Truncated", "MethodName", "StatusCode", "StatusMessage", "StatusDetails", "Timeout", "SequenceIdWithinCall", "Payload", });
internal_static_grpc_binarylog_v1alpha_Message_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_grpc_binarylog_v1alpha_Message_fieldAccessorTable = new
@ -130,6 +136,7 @@ public final class BinaryLogProto {
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_grpc_binarylog_v1alpha_Uint128_descriptor,
new java.lang.String[] { "High", "Low", });
com.google.protobuf.DurationProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)

View File

@ -71,7 +71,9 @@ public interface GrpcLogEntryOrBuilder extends
/**
* <pre>
* Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA
* Used by {SEND,RECV}_INITIAL_METADATA and
* {SEND,RECV}_TRAILING_METADATA. This contains only the metadata
* from the application.
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Metadata metadata = 4;</code>
@ -79,7 +81,9 @@ public interface GrpcLogEntryOrBuilder extends
boolean hasMetadata();
/**
* <pre>
* Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA
* Used by {SEND,RECV}_INITIAL_METADATA and
* {SEND,RECV}_TRAILING_METADATA. This contains only the metadata
* from the application.
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Metadata metadata = 4;</code>
@ -87,7 +91,9 @@ public interface GrpcLogEntryOrBuilder extends
io.grpc.binarylog.Metadata getMetadata();
/**
* <pre>
* Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA
* Used by {SEND,RECV}_INITIAL_METADATA and
* {SEND,RECV}_TRAILING_METADATA. This contains only the metadata
* from the application.
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Metadata metadata = 4;</code>
@ -96,7 +102,7 @@ public interface GrpcLogEntryOrBuilder extends
/**
* <pre>
* Used by REQUEST and RESPONSE
* Used by {SEND,RECV}_MESSAGE
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Message message = 5;</code>
@ -104,7 +110,7 @@ public interface GrpcLogEntryOrBuilder extends
boolean hasMessage();
/**
* <pre>
* Used by REQUEST and RESPONSE
* Used by {SEND,RECV}_MESSAGE
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Message message = 5;</code>
@ -112,7 +118,7 @@ public interface GrpcLogEntryOrBuilder extends
io.grpc.binarylog.Message getMessage();
/**
* <pre>
* Used by REQUEST and RESPONSE
* Used by {SEND,RECV}_MESSAGE
* </pre>
*
* <code>.grpc.binarylog.v1alpha.Message message = 5;</code>
@ -156,5 +162,105 @@ public interface GrpcLogEntryOrBuilder extends
*/
boolean getTruncated();
/**
* <pre>
* The method name. Logged for the first entry:
* RECV_INITIAL_METADATA for server side or
* SEND_INITIAL_METADATA for client side.
* </pre>
*
* <code>string method_name = 8;</code>
*/
java.lang.String getMethodName();
/**
* <pre>
* The method name. Logged for the first entry:
* RECV_INITIAL_METADATA for server side or
* SEND_INITIAL_METADATA for client side.
* </pre>
*
* <code>string method_name = 8;</code>
*/
com.google.protobuf.ByteString
getMethodNameBytes();
/**
* <pre>
* status_code and status_message:
* Only present for SEND_TRAILING_METADATA on server side or
* RECV_TRAILING_METADATA on client side.
* </pre>
*
* <code>uint32 status_code = 9;</code>
*/
int getStatusCode();
/**
* <pre>
* An original status message before any transport specific
* encoding.
* </pre>
*
* <code>string status_message = 10;</code>
*/
java.lang.String getStatusMessage();
/**
* <pre>
* An original status message before any transport specific
* encoding.
* </pre>
*
* <code>string status_message = 10;</code>
*/
com.google.protobuf.ByteString
getStatusMessageBytes();
/**
* <pre>
* The value of the 'grpc-status-details-bin' metadata key. If
* present, this is always an encoded 'google.rpc.Status' message.
* </pre>
*
* <code>bytes status_details = 11;</code>
*/
com.google.protobuf.ByteString getStatusDetails();
/**
* <pre>
* the RPC timeout
* </pre>
*
* <code>.google.protobuf.Duration timeout = 12;</code>
*/
boolean hasTimeout();
/**
* <pre>
* the RPC timeout
* </pre>
*
* <code>.google.protobuf.Duration timeout = 12;</code>
*/
com.google.protobuf.Duration getTimeout();
/**
* <pre>
* the RPC timeout
* </pre>
*
* <code>.google.protobuf.Duration timeout = 12;</code>
*/
com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder();
/**
* <pre>
* The entry sequence id for this call. The first GrpcLogEntry has a
* value of 1, to disambiguate from an unset value. The purpose of
* this field is to detect missing entries in environments where
* durability or ordering is not guaranteed.
* </pre>
*
* <code>uint32 sequence_id_within_call = 13;</code>
*/
int getSequenceIdWithinCall();
public io.grpc.binarylog.GrpcLogEntry.PayloadCase getPayloadCase();
}

View File

@ -8,7 +8,14 @@ package io.grpc.binarylog;
* A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA,
* SERVER_INIT_METADATA and TRAILING_METADATA
* Implementations may omit some entries to honor the header limits
* of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged.
* of GRPC_BINARY_LOG_CONFIG.
* Implementations will not log the following entries, and this is
* not to be treated as a truncation:
* - entries handled by grpc that are not user visible, such as those
* that begin with 'grpc-' or keys like 'lb-token'
* - transport specific entries, including but not limited to:
* ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc
* - entries added for call credentials
* </pre>
*
* Protobuf type {@code grpc.binarylog.v1alpha.Metadata}
@ -286,7 +293,14 @@ private static final long serialVersionUID = 0L;
* A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA,
* SERVER_INIT_METADATA and TRAILING_METADATA
* Implementations may omit some entries to honor the header limits
* of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged.
* of GRPC_BINARY_LOG_CONFIG.
* Implementations will not log the following entries, and this is
* not to be treated as a truncation:
* - entries handled by grpc that are not user visible, such as those
* that begin with 'grpc-' or keys like 'lb-token'
* - transport specific entries, including but not limited to:
* ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc
* - entries added for call credentials
* </pre>
*
* Protobuf type {@code grpc.binarylog.v1alpha.Metadata}

View File

@ -18,6 +18,8 @@ syntax = "proto3";
package grpc.binarylog.v1alpha;
import "google/protobuf/duration.proto";
option java_multiple_files = true;
option java_package = "io.grpc.binarylog";
option java_outer_classname = "BinaryLogProto";
@ -52,9 +54,11 @@ message GrpcLogEntry {
// The logger uses one of the following fields to record the payload,
// according to the type of the log entry.
oneof payload {
// Used by CLIENT_INIT_METADATA, SERVER_INIT_METADATA and TRAILING_METADATA
// Used by {SEND,RECV}_INITIAL_METADATA and
// {SEND,RECV}_TRAILING_METADATA. This contains only the metadata
// from the application.
Metadata metadata = 4;
// Used by REQUEST and RESPONSE
// Used by {SEND,RECV}_MESSAGE
Message message = 5;
}
@ -64,6 +68,33 @@ message GrpcLogEntry {
// true if payload does not represent the full message or metadata.
bool truncated = 7;
// The method name. Logged for the first entry:
// RECV_INITIAL_METADATA for server side or
// SEND_INITIAL_METADATA for client side.
string method_name = 8;
// status_code and status_message:
// Only present for SEND_TRAILING_METADATA on server side or
// RECV_TRAILING_METADATA on client side.
uint32 status_code = 9;
// An original status message before any transport specific
// encoding.
string status_message = 10;
// The value of the 'grpc-status-details-bin' metadata key. If
// present, this is always an encoded 'google.rpc.Status' message.
bytes status_details = 11;
// the RPC timeout
google.protobuf.Duration timeout = 12;
// The entry sequence id for this call. The first GrpcLogEntry has a
// value of 1, to disambiguate from an unset value. The purpose of
// this field is to detect missing entries in environments where
// durability or ordering is not guaranteed.
uint32 sequence_id_within_call = 13;
};
// Message payload, used by REQUEST and RESPONSE
@ -84,7 +115,15 @@ message Message {
// A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA,
// SERVER_INIT_METADATA and TRAILING_METADATA
// Implementations may omit some entries to honor the header limits
// of GRPC_BINARY_LOG_CONFIG. Implementations can choose which entries are logged.
// of GRPC_BINARY_LOG_CONFIG.
//
// Implementations will not log the following entries, and this is
// not to be treated as a truncation:
// - entries handled by grpc that are not user visible, such as those
// that begin with 'grpc-' or keys like 'lb-token'
// - transport specific entries, including but not limited to:
// ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc
// - entries added for call credentials
message Metadata {
repeated MetadataEntry entry = 1;
}