-
Notifications
You must be signed in to change notification settings - Fork 704
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
Extended Valkey client introspection functionality #668
Comments
Originally reference from redis/redis#12311. |
Nit Title: Extended Client Introspection functionality The default behavior for The downside of introducing the new API is maintaining two set of API(s) and no guarantee of administrator(s) of moving to this. |
Old habits die hard.
I think you raise a really good point. We could add a pagination functionality by doing client-list based off of ID, and add that to client list. I think we have seen that people generally don't migrate to new commands, so it probably makes more sense to enhanced the ones we have. |
@valkey-io/core-team I'm happy to take this issue up if this is an approved change. Please let me know if I can proceed. |
We can abstract the current filtering logic out (and add new filters) and then use it in different commands as required. In my opinion, CLIENT DESCRIBE (if approved) should be taken in a separate PR. |
I feel |
CLIENT KILL has more filters than any other. Let's first add the missing ones of those to CLIENT LIST, to unify them. We can de-duplicate the parsing code too. That's a good PR to start with IMHO. |
Sorry, is there the command CLIENT COUNT? new command? |
I like this idea. In #1398 , I hope we have a |
I would like to summarize the issues that we are going to solve under #668. Please feel free to add any that I have missed.
@valkey-io/core-team are we good to proceed with all the above mentioned issues? I can come with the separate issues for each, so this can be picked up by multiple people. We can even discuss in detail about each of these in their respective issues. |
To me, it seems safe to proceed with 1-3. For 4, I think we should discuss it a bit more first. I don't want to add a new command that almost nobody will use (like CLUSTER SHARDS) so I want to have a good motivation about uses cases and the features (more fields? pagination?), the syntax, etc. |
The PR for unifying LIST and KILL is almost ready to be merged and there are already PRs for adding more filters and adding a CLIENT COUNT command. @valkey-io/core-team Let's make a decision about which filters we actually want to add before we spend too much time on the PRs.
Can we also make a decision about adding |
Adds filter options to CLIENT LIST: * USER <username> Return clients authenticated by <username>. * ADDR <ip:port> Return clients connected from the specified address. * LADDR <ip:port> Return clients connected to the specified local address. * SKIPME (YES|NO) Exclude the current client from the list (default: no). * MAXAGE <maxage> Only list connections older than the specified age. Modifies the ID filter to CLIENT KILL to allow multiple IDs * ID <client-id> [<client-id>...] Kill connections by client ids. This makes CLIENT LIST and CLIENT KILL accept the same options. For backward compatibility, the default value for SKIPME is NO for CLIENT LIST and YES for CLIENT KILL. The MAXAGE comes from CLIENT KILL, where it *keeps* clients with the given max age and kills the older ones. This logic becomes weird for CLIENT LIST, but is kept for similary with CLIENT KILL, for the use case of first testing manually using CLIENT LIST, and then running CLIENT KILL with the same filters. The `ID client-id [client-id ...]` no longer needs to be the last filter. The parsing logic determines if an argument is an ID or not based on whether it can be parsed as an integer or not. Partly addresses: #668 --------- Signed-off-by: Sarthak Aggarwal <[email protected]>
|
We have ADDR but it is ip:port. The client port is random, not useful for filtering I think. Should we have IP instead of ADDR? Or let ADDR be used without port? |
Adds filter options to CLIENT LIST: * USER <username> Return clients authenticated by <username>. * ADDR <ip:port> Return clients connected from the specified address. * LADDR <ip:port> Return clients connected to the specified local address. * SKIPME (YES|NO) Exclude the current client from the list (default: no). * MAXAGE <maxage> Only list connections older than the specified age. Modifies the ID filter to CLIENT KILL to allow multiple IDs * ID <client-id> [<client-id>...] Kill connections by client ids. This makes CLIENT LIST and CLIENT KILL accept the same options. For backward compatibility, the default value for SKIPME is NO for CLIENT LIST and YES for CLIENT KILL. The MAXAGE comes from CLIENT KILL, where it *keeps* clients with the given max age and kills the older ones. This logic becomes weird for CLIENT LIST, but is kept for similary with CLIENT KILL, for the use case of first testing manually using CLIENT LIST, and then running CLIENT KILL with the same filters. The `ID client-id [client-id ...]` no longer needs to be the last filter. The parsing logic determines if an argument is an ID or not based on whether it can be parsed as an integer or not. Partly addresses: valkey-io#668 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: proost <[email protected]>
I propose the following candidates: ADDR ip:port |
I am directionally aligned with the proposal, more specifically, I like the following proposals
|
IMHO, ADDR(ip:port) is not a filter, but since it already exists, we have to continue maintaining it. We could consider adding a new filter, such as |
How about overloading it and allow Confusing? New filter is better? |
Adds filter options to CLIENT LIST: * USER <username> Return clients authenticated by <username>. * ADDR <ip:port> Return clients connected from the specified address. * LADDR <ip:port> Return clients connected to the specified local address. * SKIPME (YES|NO) Exclude the current client from the list (default: no). * MAXAGE <maxage> Only list connections older than the specified age. Modifies the ID filter to CLIENT KILL to allow multiple IDs * ID <client-id> [<client-id>...] Kill connections by client ids. This makes CLIENT LIST and CLIENT KILL accept the same options. For backward compatibility, the default value for SKIPME is NO for CLIENT LIST and YES for CLIENT KILL. The MAXAGE comes from CLIENT KILL, where it *keeps* clients with the given max age and kills the older ones. This logic becomes weird for CLIENT LIST, but is kept for similary with CLIENT KILL, for the use case of first testing manually using CLIENT LIST, and then running CLIENT KILL with the same filters. The `ID client-id [client-id ...]` no longer needs to be the last filter. The parsing logic determines if an argument is an ID or not based on whether it can be parsed as an integer or not. Partly addresses: valkey-io#668 --------- Signed-off-by: Sarthak Aggarwal <[email protected]>
In my opinion, new filter sounds better for |
We want to standardize the way that admin users can describe and interact with the client commands. We are proposing to generalize the filters introduced in CLIENT KILL so that it also works to count and list clients as well.
The following commands could work with the same set of filters.
The supported filters are to be decided. Suggestions, including already existing filters:
for compatibility reasons with client list, client-id must be specified last.<shard channel the client must subscribe to>
(Needed?)CLIENT LIST FLAGS "bPt"
.MIN-IDLE) minimum idle time of the client.More filter suggestions that came up during discussions:
ADDR ip
. (The existing filter syntaxADDR ip:port
is not very useful, because the client's port is ephemeral and will change for each connection.)In Redis we also discussed adding a new command,
CLIENT DESCRIBE
, will also introduce the notion of selectors. Selectors allow you to scope down the fields you are interested in.The text was updated successfully, but these errors were encountered: