chproxy
chproxy copied to clipboard
[QUESTION] Can chproxy count the number of connections per IP address and user?
Which feature your question relates to? E.g caching with redis, user authentication...
Question details Can chproxy count the number of connections per IP address and user? After using chproxy, all the IPs that the clickhouse service can query are from the chproxy node, making it difficult to troubleshoot the connection status of each use.
Additional context/motivations
chproxy forwards requests with http_user_agent carrying client addresss;
:) select COLUMNS('http*') from system.query_log limit 5
SELECT COLUMNS('http*')
FROM system.query_log
LIMIT 5
Query id: 51e2394b-9406-4b2c-9a74-01624557bac9
┌─http_method─┬─http_user_agent────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─http_referer─┐
│ 2 │ RemoteAddr: 10.244.74.185:44234; LocalAddr: 10.244.178.186:80; CHProxy-User: user_dlreadonly; CHProxy-ClusterUser: user_dlreadonly; Go-http-client/1.1 │ │
│ 2 │ RemoteAddr: 10.244.74.185:44234; LocalAddr: 10.244.178.186:80; CHProxy-User: user_dlreadonly; CHProxy-ClusterUser: user_dlreadonly; Go-http-client/1.1 │ │
│ 1 │ Go-http-client/1.1 │ │
│ 1 │ Go-http-client/1.1 │ │
│ 2 │ RemoteAddr: 10.244.74.185:49826; LocalAddr: 10.244.74.135:80; CHProxy-User: user_dlreadonly; CHProxy-ClusterUser: user_dlreadonly; Go-http-client/1.1 │ │
└─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┘