Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Need to be able to collect caller stacks via ActiveSupport::Notifications #5933

Closed
gnarg opened this Issue Apr 23, 2012 · 3 comments

Comments

Projects
None yet
2 participants

gnarg commented Apr 23, 2012

Hi,

For use in the New Relic Ruby agent, we need to be able to collect arbitrary caller execution stacks. We do this to indicate to users where in their code certain slow actions are taking place (eg slow db transactions). Collecting traces for raised exceptions is not a problem, but deciding post-facto that we want to know what the callers to a particular method seems difficult.

I talked briefly to Mr. Katz at GoGaRuCo and Ruby on Ales and he suggested I open a ticket for discussion on the topic. I recently got the chance to work on this, so I figured RailsConf would be a good time to bring this up.

Thanks for your attention.

Regards,
Jon

Owner

tenderlove commented Apr 23, 2012

Hi Jon,

Would you mind giving an example? I think I understand, but I want to make
100% sure. You're saying that you want to get the stack trace for a
particular function after execution has left that program control has
left that frame?

On Monday, April 23, 2012, Jon Guymon wrote:

Hi,

For use in the New Relic Ruby agent, we need to be able to collect
arbitrary caller execution stacks. We do this to indicate to users where
in their code certain slow actions are taking place (eg slow db
transactions). Collecting traces for raised exceptions is not a problem,
but deciding post-facto that we want to know what the callers to a
particular method seems difficult.

I talked briefly to Mr. Katz at GoGaRuCo and Ruby on Ales and he suggested
I open a ticket for discussion on the topic. I recently got the chance to
work on this, so I figured RailsConf would be a good time to bring this up.

Thanks for your attention.

Regards,
Jon


Reply to this email directly or view it on GitHub:
#5933

Aaron Patterson
http://tenderlovemaking.com/

gnarg commented Apr 26, 2012

Hi Aaron,

I spoke with you about this some at RailsConf. With your new entry/exit event mechanism this may be handled. The remaining problem may that we won't know if we needed a stack trace (ie a duration threshold is passed) until after we receive the exit event, as which point it may be too late. I'll have to experiment with a prototype agent that just logs to a file or something like that.

At any rate, I think I have all I need to proceed. Thanks for your help, I'll get back to you after I've done some further investigation.

gnarg commented Jun 15, 2012

I think I have this sorted out - see #5932

@gnarg gnarg closed this Jun 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment