-
Notifications
You must be signed in to change notification settings - Fork 375
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
Redis Service #135
Comments
Hi @BaneOfSerenity indeed this is clearly on our TODO list, will ping you whenever we release support for this config option. |
Would like to see this too 👍 |
Want to see if this PR does what you were thinking? #190 It adds config for |
Hello @BaneOfSerenity! currently we're shipping the 0.11.0 that introduces a new way to configure the require 'redis'
require 'ddtrace'
Datadog.configure do |c|
c.use :redis, service_name: 'redis' # default service name
end
# traced clients
customer_cache = Redis::Client.new
invoice_cache = Redis::Client.new
# change service names for each client
Datadog.configure(customer_cache, service_name: 'customer-cache')
Datadog.configure(invoice_cache, service_name: invoice-cache') I'm closing the issue since it can be considered fixed, but feel free to write your thoughts here! Also I want to say thank you again to @nerdrew because his work has been very important to us and improved a lot our configuration system. |
Sorry about the lack of response to the last reply. This looks great. Thanks! |
Hey @palazzem @nerdrew i've got an implementation question. I was wondering, since i'm running two separate redis endpoints for Do I do something like this?
I'm not sure how i grab the redis object for config.after_initialize do
Datadog.configure([whereever the sidekiq redis client is?], service_name: 'redis-sidekiq')
end |
@rromanchuk The As for getting Redis for Sidekiq, that's a bit trickier... looking at Sidekiq's Redis connection code, it looks like they have a connection pool of Redis clients, which seems to suggest there are many of them. The trick would be to inject code to wrap each of those clients with the appropriate configuration, which will require a bit of monkey patching. I might try something like the following (although this is entirely untested, and might require changes):
|
If you're using rails own RedisCacheStore you're fine using: Datadog.configure(Rails.cache.redis._store, service_name: 'my-app-cache-redis') Notice that the If you're setting any pooling options |
I have an application where it has to connect to 2 separate redis servers. I would like to set the service on each connection separately but right now it seems the redis service is a constant and can't be changed. If it could be passed into the patched initializer with the rest of the args that would be great.
The text was updated successfully, but these errors were encountered: