apm-agent-ruby icon indicating copy to clipboard operation
apm-agent-ruby copied to clipboard

Report back all ActiveRecord init statements in the DB span

Open dnorth98 opened this issue 6 years ago • 1 comments

Using 2.11.0 of the elastic-apm gem

Comparing the elastic-apm capture to another package, it looks like it strips the ActiveRecord session initialization parameters from the span. For example, a different APM solution shows the active record init parameters along with the query but these seem to be missing from the span in ES.

Why this is helpful is because in this specific example below, the ActiveRecord DB commands run whenever AR has to provision a new connection from the database pool. We have found these can be significantly slow (and show as such in other examples) but when viewing these in the ES APM, the trace only shows the actual SELECT, missing some other important data.

Active Record also obtains advisory locks in the session which can take a while to obtain where there is lock contention so it's super helpful to be able to see the ActiveRecord items in the trace.

Sample span/trace from a different APM solution. image

dnorth98 avatar Sep 26 '19 15:09 dnorth98

Hi @dnorth98 Thanks for the suggestion. We’ll look into the feasibility of adding this and have an update soon. Thanks!

estolfo avatar Sep 27 '19 09:09 estolfo