Repository: envoyproxy/envoy
File: api/envoy/data/tap/v3/transport.proto (Protocol Buffers)

Code before:

  // The connection was closed.
  message Closed {
    // TODO(mattklein123): Close event type.

    option (udpa.annotations.versioning).previous_message_type =
        "envoy.data.tap.v2alpha.SocketEvent.Closed";
  }

  // Timestamp for event.
  google.protobuf.Timestamp timestamp = 1;

  // Read or write with content as bytes string.
  oneof event_selector {
    Read read = 2;

    Write write = 3;

    Closed closed = 4;
  }

  // Connection information per event
  Connection connection = 5;

  // Data byte sequence number
  uint64 byte_seq_num = 6;
}

// Sequence of read/write events that constitute a buffered trace on a socket.
// [#next-free-field: 6]
message SocketBufferedTrace {
  option (udpa.annotations.versioning).previous_message_type =
      "envoy.data.tap.v2alpha.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 connection = 2;

  // Sequence of observed events.
  repeated SocketEvent events = 3;

  // Set to true if read events were truncated due to the :ref:`max_buffered_rx_bytes
  // <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_rx_bytes>` setting.
  bool read_truncated = 4;

  // Set to true if write events were truncated due to the :ref:`max_buffered_tx_bytes
  // <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_tx_bytes>` setting.
  bool write_truncated = 5;

Review comment (suggestion):
```suggestion
  // Data sequence number
  uint64 seq_num = 6;
```

Or s/byte/event. This is not byte specific.

Code after:

  // The connection was closed.
  message Closed {
    // TODO(mattklein123): Close event type.

    option (udpa.annotations.versioning).previous_message_type =
        "envoy.data.tap.v2alpha.SocketEvent.Closed";
  }

  // Timestamp for event.
  google.protobuf.Timestamp timestamp = 1;

  // Read or write with content as bytes string.
  oneof event_selector {
    Read read = 2;

    Write write = 3;

    Closed closed = 4;
  }

  // Connection information per event
  Connection connection = 5;

  // Data sequence number
  uint64 seq_num = 6;
}

// Sequence of read/write events that constitute a buffered trace on a socket.
// [#next-free-field: 6]
message SocketBufferedTrace {
  option (udpa.annotations.versioning).previous_message_type =
      "envoy.data.tap.v2alpha.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 connection = 2;

  // Sequence of observed events.
  repeated SocketEvent events = 3;

  // Set to true if read events were truncated due to the :ref:`max_buffered_rx_bytes
  // <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_rx_bytes>` setting.
  bool read_truncated = 4;

  // Set to true if write events were truncated due to the :ref:`max_buffered_tx_bytes
  // <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_tx_bytes>` setting.
  bool write_truncated = 5;