-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Better approach for asynchronous spans #27
Comments
@SimonSimCity elastic apm is already tracing async executions. Depending on the async context |
@SimonSimCity if you have sample project where tracing is broken, that would be helpful. |
I can tell you so far that I've disabled If you have the time, I'd very much appreciate it if you would take a look into it. We're currently in our high-season which forces me to focus on short-term fixes to keep everything running for this season, but I'll definitively come back to this once it's a bit more relaxed over here. |
Never encountered this issue. Let's keep this issue open, I will investigate it. Unfortunately I am also experiencing lack of time. |
I've just noticed this PR which could be related ... elastic/apm-agent-nodejs#1306 |
Does this PR elastic/apm-agent-nodejs#1306 actually solved problem for you @SimonSimCity? |
A good question ... I've disabled the async-spans as they just filled my monitoring without adding additional value. If someone coudl confirm that this works on all of the processes on a busy machine, that would be nice. |
The spans - specially the span
async
- are often very misleading. This was already an issue in Kadira.Imagine a meteor method is executed which connects to the database. While it is waiting for the database another call comes in - let's say, an HTTP request. NodeJS will start processing the second request, which replaces the
agent.currentTransaction
. If the second process now starts waiting for the database and the first comes back and you do some work asynchronously, those might get logged to the wrong request.A better approach would be to write the current transaction as a reference to the fibers instance, but this is something I have to dive into. One idea would also be to look into
async_hooks
: https://nodejs.org/api/async_hooks.htmlThe text was updated successfully, but these errors were encountered: