Missing timing information for TCP accesslog
#38.722 aberto em 12 de mar. de 2025
Métricas do repositório
- Stars
- (27.997 stars)
- Métricas de merge de PR
- (Mesclagem média 8d) (378 fundiu PRs em 30d)
Description
Title: As titled
Description: We have these fields defined in the accesslog common properties.
time_to_last_rx_bytetime_to_first_upstream_tx_bytetime_to_last_upstream_tx_bytetime_to_first_upstream_rx_bytetime_to_last_upstream_rx_bytetime_to_first_downstream_tx_byte
However using a configuration with listener level grpc accesslog, along with tcp proxy, and then setup the gRPC accesslog server in go, I see nil for all these attributes.
This will be useful for envoyproxy used a TCP proxy and debugging lots of connection termination details.
fmt.Printf("the connection: common.GetTimeToLastRxByte() %v, common.GetTimeToFirstDownstreamTxByte() %v,\n"+
"common.GetTimeToLastDownstreamTxByte() %v, common.GetTimeToFirstUpstreamRxByte() %v\n,"+
"common.GetTimeToLastUpstreamRxByte() %v, common.GetTimeToFirstUpstreamTxByte() %v, common.GetTimeToLastUpstreamTxByte() %v\n",
common.GetTimeToLastRxByte(), common.GetTimeToFirstDownstreamTxByte(),
common.GetTimeToLastDownstreamTxByte(), common.GetTimeToFirstUpstreamRxByte(), common.GetTimeToLastUpstreamRxByte(),
common.GetTimeToFirstUpstreamTxByte(), common.GetTimeToLastUpstreamTxByte(),
)
Checking code, looks like function onUpstreamTxByteSent is only invoked on router/generic proxy router filter, rather than tcp proxy filter. probably adding such invocation in the tcp_proxy filter's onUpstreamData/onData can be added to fill in these information.
Appendix
envoy config.
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 8090
access_log:
- name: envoy.tcp_grpc_access_log
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.grpc.v3.TcpGrpcAccessLogConfig
common_config:
log_name: accesslog
grpc_service:
envoy_grpc:
cluster_name: ch-accesslog
transport_api_version: V3
filter_chains:
- filters:
- name: envoy.filters.network.tcp_proxy
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
stat_prefix: tcp
cluster: clickhouse_tcp