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

Support different redis db inside the same instance. #276

Closed
mastrolinux opened this issue Nov 23, 2012 · 7 comments
Closed

Support different redis db inside the same instance. #276

mastrolinux opened this issue Nov 23, 2012 · 7 comments
Assignees

Comments

@mastrolinux
Copy link
Contributor

Since python redis does not support select: https://github.com/andymccurdy/redis-py#thread-safety

And some users uses different db in the same redis instance-port pair, could be good to support the syntax:

redis_urls: password@host:9002:2 in the redis.conf file

to access for example:

redis.StrictRedis(host='host', port=9002, db=2, password='password')

now is only supported:

``redis.StrictRedis(host='host', port=9002, password='password')`

You should change the _get_conn methond from
def _get_conn(self, host, port, password):

to def _get_conn(self, host, port, password, db):

@clutchski
Copy link
Contributor

Correct me if I'm wrong, but I think the redis INFO command returns the same data regardless of what DB it's connected to. Is there something particular you're looking to get by querying each database?

@mastrolinux
Copy link
Contributor Author

Custom queries are almost impossible with the current api interface. To add the needed queries we do not have to just add our queries but to change your connection method and make our agent not fully compatible with your. Could be good to have an abstract interface supporting all connections parameters currently supported by python-redis.

@clutchski
Copy link
Contributor

Oh I see, you want to collect metrics from specific queries. Out of curiosity, what kind of data are you collecting? I'm wondering if it belongs in the generic redis check or a custom check? Or are you just looking to extend the current redis check to make a custom check?

@mastrolinux
Copy link
Contributor Author

I am just looking to extend the current redis check to make customs checks using the same interface and methods you alredy use instead of writing again them from scratch breaking compatibility.
I am collecting the number of value for a key (like a count) they are bloking queries running on the slave only. We use the slave for all the monitoring queries.

@alq666
Copy link
Member

alq666 commented Mar 8, 2013

Slotting this for 3.7. The configuration format has changed, which will make our work easier as a matter of fact.

@ghost ghost assigned remh May 3, 2013
@remh
Copy link
Contributor

remh commented May 3, 2013

Will be done for 3.7.1 or 3.8.0

@mastrolinux
Copy link
Contributor Author

Very cool, thanks.

@remh remh closed this as completed in d8e3aa1 May 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants