Git Product home page Git Product logo

Comments (10)

delner avatar delner commented on August 22, 2024 1

Hey @senny , we're going to look at this in a couple of weeks. I'll keep you updated.

from dd-trace-rb.

senny avatar senny commented on August 22, 2024

I was hoping that #270 would allow us to split queries by using a span processor. Unfortunately, the rails.database.name tag is always set to the default connection, regardless of the query that's being annotated.

It's a bit confusing as the name suggests that it is possible to tell different databases on the same Rails app apart.

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

Ahhhh yeah, this is a good point. I think having the ability to configure individual ActiveRecord connections might be the best way to go here. Maybe something like:

Datadog.configure do
  use :rails
end

Datadog.configure(Foo.connection, service_name: 'foo-db')
Datadog.configure(Bar.connection, service_name: 'bar-db')

...or something similar. In the shorter term, we might be able to pull the connection from the sql.active_record event and get the correct DB name from that.

ActiveRecord needs a bit more love; I'd be happy to take a deeper dive into this when we tackle it.

from dd-trace-rb.

senny avatar senny commented on August 22, 2024

@delner yes, something like this would be perfect. Since it's in an initializer it should ideally not open the connection. Maybe it's possible just by using the name of the connection specification in database.yml.

from dd-trace-rb.

lattwood avatar lattwood commented on August 22, 2024

@delner anything to update?

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

@lattwood Not yet, other than it's still queued up on our roadmap. Will let you know what develops.

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

FWIW @senny and @lattwood #383 should tag sql.active_record events with the correct connection information now (instead of the default.) Still don't have support for tracking those different DB connections as different services yet, which is something we'll have to add.

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

Hey @senny and @lattwood , #404 is currently in development and should resolve this. Feel free to check it out!

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

We made another PR #451 that improves upon the configuration behavior; this is currently in review pending some other changes to our configuration API.

from dd-trace-rb.

delner avatar delner commented on August 22, 2024

Hey @senny , we merged #451 which should roll with our 0.14.0 release. Feel free to try it out and let us know what you think. Thanks for the suggestion; glad to have added this to the tracer! Closing this issue for now.

from dd-trace-rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.