Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Can chproxy count the number of connections per IP address and user? #346

Open
FWLamb opened this issue Jun 19, 2023 · 1 comment
Labels

Comments

@FWLamb
Copy link

FWLamb commented Jun 19, 2023

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

@cangyin
Copy link

cangyin commented Jun 29, 2023

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  │              │
└─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants