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

Expose active Redis connection count #2376

Closed
2 tasks
nakedible-p opened this issue Oct 1, 2024 · 7 comments
Closed
2 tasks

Expose active Redis connection count #2376

nakedible-p opened this issue Oct 1, 2024 · 7 comments
Assignees
Labels
Feature Additional feature, big or small User issue Issue openned by users
Milestone

Comments

@nakedible-p
Copy link

Describe the feature

It would be nice to be able to query the client about at least some status and statistics information to be logged. The first piece of information that's interesting is the currently active connection count.

Use Case

We want to log the currently active connection count towards Redis, so we can make a metric of it and track it. It's also not obvious what that is without getting the real data as the cluster layout affects it. It's also a resource tracking issue possibly. There's a ton of other values that could be exposed as well.

Proposed Solution

Add a simple get_active_connection_count() call. Alternatively, something like get_statistics() which would return an object which has this value and a bunch of other values. Something like this is a good example of a full blown solution: https://docs.rs/tokio/latest/tokio/runtime/struct.RuntimeMetrics.html

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Client version used

1.1.0

Environment details (OS name and version, etc.)

irrelevant

@avifenesh
Copy link
Collaborator

This information is available using INFO, in connected_clients field and a bunch of a lot of extra stats you can retrieve.
connected_clients exclude replica's connection.
Do you have a special case which this field not cover?

@nakedible-p
Copy link
Author

Oh, perhaps I wasn't clear. I want info logged from the behaviour of this specific client – not INFO from the remote Redis server. I want the number of connections for this client, as given by the client itself, not as given by the server.

@asafpamzn
Copy link
Collaborator

asafpamzn commented Oct 1, 2024

Thanks,

I agree that we should improve and expose the clients metrics. I agree that it is more than just connected clients, can be latency, errors, internal reconnects attempts...
@eifrah-aws FYI.

@asafpamzn
Copy link
Collaborator

Marking a candidate for 1.2

@eifrah-aws
Copy link
Contributor

@nakedible-p note that for this solution, I have chosen to take the path of providing telemetry for the entire process. i.e. if you have 2 clients opened, it will report all opened connections for both of them (the sum of it). In addition, it will also report how many active clients there are

@ikolomi
Copy link
Collaborator

ikolomi commented Nov 18, 2024

@asafpamzn i dont see how it makes into 1.2 - lets discuss

Binding status:
Java -done
Python - @BoazBD WIP
Node - @Muhammad-awawdi-amazon WIP

@eifrah-aws
Copy link
Contributor

eifrah-aws commented Nov 24, 2024

Marking this as completed. We now have get_statistics (getStatistics for Java) API for GlideClusterClient and GlideClient which returns a Map. This is supported for Node, Java & Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Additional feature, big or small User issue Issue openned by users
Projects
Status: Done
Development

No branches or pull requests

5 participants