-
Notifications
You must be signed in to change notification settings - Fork 373
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
Rails databases: {} option #574
Comments
Hey @senny , glad to here you're excited about the new database support! I think what you have above was our original implementation of multi-DB configuration, which we reworked a bit, and migrated to its own integration, Datadog.configure do |c|
c.use :active_record, describes: :archive, service_name: 'archive-db'
c.use :active_record, describes: :follower, service_name: 'follower-db'
end In the future, we might add a shortcut configuration option directly to The reason for this is was the introduction of multiplexing: subdivisions of unique tracer settings by key (in this case, by each database.) in the future as the integration matures, you'll be able to configure a full set of trace settings for different DBs, instead of just Let me know if this configuration works for you! |
@delner thanks for the details. I guess I got stuck on the |
Yeah you're absolutely right @senny the documentation is inaccurate here. I updated the code sample in ActiveRecord, but I neglected all the surrounding information and Rails itself. I'll have to fix this to be a bit more clear. Also yes, To us, this is suboptimal and a bit clumsy. I have some plans to try to streamline this a bit, by basically turning Rails into a "composite" integration, which is composed of sub-integrations like ActiveRecord. The hope is you'll be able to configure ActiveRecord within the Rails group instead of having to configure it separately. Something like: Datadog.configure do |c|
c.use :rails do |rails|
rails.service_name = 'my-app'
# Settings for ActiveRecord tracing
rails.active_record do |active_record|
active_record.service_name = 'my-database'
end
end
end The foundations for this were already laid in #450. Still need to figure out how to introduce the |
Documentation for this will be fixed by #578. |
The documentation change was merged and will be released with 0.17.0. Going to close this for now. If you have any other questions or comments regarding configuring databases like this, please feel free to comment or re-open. |
Going through the changelogs of recent versions I found that support for multiple AR databases is now supported out of the box! 🎉
I tried to change our setup which was based on span preprocessors to use the new
databases:
option when configuring Rails. Unfortunately, I was not able to get it to work and everything was tracked in the database service specified asdatabase_service
.My configuration was something like this:
I tried to find how
databases:
is applied but I was not able to find the right spot. (I was mainly looking at framework.rb)Would you be able to give me a hint where I can follow-up to get this working? Thanks a lot in advance and great work on the rapid pace of new features!
The text was updated successfully, but these errors were encountered: