-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add instrumentation for Q #206
Conversation
thanks, @mdlavin! i'll roll this into the next release. |
@mdlavin i seem to have missed the second commit on this branch, i'll roll that into the next release. sorry for the mix up! |
The second commit is pretty important. Q will throw exceptions without it By the way, thanks for the quick merging.
|
yeah, i'm planning on putting out a release out next week with a few bug fixes - this being one of them. should be early in the week, maybe monday or tuesday. |
OK. If there are users that are using Q today, they will likely open an
|
alright, this has been merged out of band. thanks for being patience! |
Hey, @lykkin @martinkuba your promise instrumentation in node-newrelic is really weird. You override native promise methods. We want to use newrelic but can't because of how it instruments promises. Wouldn't it be better to add a I'm a bluebird and Q contributor, I wrote the |
You can also contact me at |
@benjamingr could you elaborate on what it is about the way New Relic instruments promises that prevents you from using it? as for wrapping unhandledRejection, it probably is something that should be supported, but does not replace the need for implementation specific instrumentation. The instrumentation is not to report errors, it is designed to propagate transactions across async boundaries. it is fairly trivial to report errors for unhandled rejections: process.on('unhandledRejection', function(reason, p) {
newrelic.noticeError(new Error('UnhandledRejection: ' + reason))
}); |
@benjamingr Thanks for reaching out. This is good timing, as we are looking at Bluebird as well. Our main goal at this point is to make sure that state is properly preserved when using promises, so that different transactions don't get mixed up. We thought this PR accomplished that, but we are definitely open to suggestions. PRs are always welcome! I would be happy to collaborate on this. |
I'm confused, wouldn't it make more sense to use domains or the newer AsyncWrap API for that?
I think for the very least the default should be to As for async boundaries - I'm not sure how you think that'd work in a reasonable way with regards to performance - it would likely cause a performance slowdown (like capturing async stack traces does). Bluebird has a monitoring API and you can use that + a |
Or, if you just want to run code whenever bluebird schedules stuff - you can use Note that bluebird may omit async scheduling when it deems that actions have already happened asynchronously anyway (for example, running |
Also, welcome to the (Node) foundation :) |
Release v7.0.0
Release v7.0.0
My project uses Q for promises and I've noticed that when Q and newrelic are used together, the recorded segments are sometimes lost or placed on the wrong transaction.
It turns out that Q has it's own internal queue and depending on the ordering of calls to Q APIs, the transactions can get lost or the wrong one picked up.