tap: implement streaming tap for the transport socket (#6105)

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 6c778c5213b8efc2e5fd172a217ea6dfdfd9aaa0
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 904f15887d
commit 427bb19122
  1. 2
      envoy/data/tap/v2alpha/http.proto
  2. 37
      envoy/data/tap/v2alpha/transport.proto
  3. 3
      envoy/data/tap/v2alpha/wrapper.proto

@ -32,7 +32,7 @@ message HttpBufferedTrace {
Message response = 2; Message response = 2;
} }
// A streamed trace segment. Multiple segments make up a full trace. // A streamed HTTP trace segment. Multiple segments make up a full trace.
message HttpStreamedTraceSegment { message HttpStreamedTraceSegment {
// Trace ID unique to the originating Envoy only. Trace IDs can repeat and should not be used // Trace ID unique to the originating Envoy only. Trace IDs can repeat and should not be used
// for long term stable uniqueness. // for long term stable uniqueness.

@ -18,10 +18,6 @@ import "google/protobuf/timestamp.proto";
// Connection properties. // Connection properties.
message Connection { message Connection {
// Global unique connection ID for Envoy session. Matches connection IDs used
// in Envoy logs.
uint64 id = 1;
// Local address. // Local address.
envoy.api.v2.core.Address local_address = 2; envoy.api.v2.core.Address local_address = 2;
@ -51,26 +47,51 @@ message SocketEvent {
bool end_stream = 2; bool end_stream = 2;
} }
// The connection was closed.
message Closed {
// TODO(mattklein123): Close event type.
}
// Read or write with content as bytes string. // Read or write with content as bytes string.
oneof event_selector { oneof event_selector {
Read read = 2; Read read = 2;
Write write = 3; Write write = 3;
Closed closed = 4;
} }
} }
// Sequence of read/write events that constitute a buffered trace on a socket. // Sequence of read/write events that constitute a buffered trace on a socket.
message SocketBufferedTrace { message SocketBufferedTrace {
// Trace ID unique to the originating Envoy only. Trace IDs can repeat and should not be used
// for long term stable uniqueness. Matches connection IDs used in Envoy logs.
uint64 trace_id = 1;
// Connection properties. // Connection properties.
Connection connection = 1; Connection connection = 2;
// Sequence of observed events. // Sequence of observed events.
repeated SocketEvent events = 2; repeated SocketEvent events = 3;
// Set to true if read events were truncated due to the :ref:`max_buffered_rx_bytes // Set to true if read events were truncated due to the :ref:`max_buffered_rx_bytes
// <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_rx_bytes>` setting. // <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_rx_bytes>` setting.
bool read_truncated = 3; bool read_truncated = 4;
// Set to true if write events were truncated due to the :ref:`max_buffered_tx_bytes // Set to true if write events were truncated due to the :ref:`max_buffered_tx_bytes
// <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_tx_bytes>` setting. // <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_tx_bytes>` setting.
bool write_truncated = 4; bool write_truncated = 5;
}
// A streamed socket trace segment. Multiple segments make up a full trace.
message SocketStreamedTraceSegment {
// Trace ID unique to the originating Envoy only. Trace IDs can repeat and should not be used
// for long term stable uniqueness. Matches connection IDs used in Envoy logs.
uint64 trace_id = 1;
oneof message_piece {
// Connection properties.
Connection connection = 2;
// Socket event.
SocketEvent event = 3;
}
} }

@ -27,5 +27,8 @@ message TraceWrapper {
// A socket buffered tap trace. // A socket buffered tap trace.
SocketBufferedTrace socket_buffered_trace = 3; SocketBufferedTrace socket_buffered_trace = 3;
// A socket streamed tap trace segment.
SocketStreamedTraceSegment socket_streamed_trace_segment = 4;
} }
} }

Loading…
Cancel
Save