-
Notifications
You must be signed in to change notification settings - Fork 227
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
Async spans are being reported as sync #1996
Comments
@dgieselaar Thanks for reporting this behavior. First -- looking through the changelog, 3.9 includes a fix where we were incorrectly setting the Second -- what about the spans involved makes you believe they should be marked as With the above information we'll be able to have a better information conversation about all this :) Thanks again for reporting! |
Could be, yeah. I haven't tested all versions.
It's an elasticsearch span, and it was previously reported as async. Maybe I'm missing something, but it seems like it (obviously?) should not be reported as blocking?
The issue seems fairly obvious to me and I'm not sure why a repro here is necessary. I probably don't have time for that, but let me know if I can help out otherwise, happy to chat on Slack about it next week if needed. |
That's fair @dgieselaar -- here's my take on things.
Without knowing more about the code that produced these spans we can't say whether this is a bug or just a nuance of the library being instrumented. With a reproduction we'll
So a reproduction will give us the context we need to diagnose this. No worries if you can't provide a reproduction -- I know how roadmaps are. :) However, without a reproduction we'll need to come up with one on our own. In addition to the time this will take us we may end up diagnosing a similar case that's unrelated to the case that you're reporting -- we don't have your valuable context. That's why, ideally, we prefer to get reproductions with out bug reports. Finally, because of the above mentioned ambiguity and our own roadmaps we're not likely to immediately prioritize this. With a clear reproduction a quick fix may be immediately apparent and we won't need to defer this to our next bit of maintenance work. Does that make sense? Or am I missing something that's obvious to you but not to me? |
@astorm I won't tell you what to prioritise :) but a hard disagree from me that there is any ambiguity about whether this is a bug. This is out-of-the-box behaviour. The consequence is that the Elasticsearch span (and other custom spans) show up as "blocking" in the UI. I don't think that users expect these spans to be identified as blocking. Personally I'd look at this from a user's perspective, instead of arguing upwards from the current implementation. I'll leave further action up to your discretion, though. Edit, re:
I should be more specific. This is happening with Kibana's instrumentation, and other custom instrumentation other teams have added outside of Kibana. |
Pretty sure (though only and educated guess, I haven't confirmed) this happens on Elasticsearch spans because there is the synchronously-created HTTP span underneath. I.e. this is the same issue as described and worked around for S3 spans here: I believe this will end up getting fixed as part of #2181 and #2000 |
Current `span.sync` is tracked via: - the "before" async hook setting it false on the "active" span, and - Instrumentation#bindFunction's wrapper setting it false, on the fair assumption that all usages of bindFunction are for async callbacks. The former has issues when there are multiple active spans within a single async task -- as is the case with Elasticsearch instrumentation (issue #1996) and the aws-sdk instrumentations (which have manual workarounds). This changes to set sync=false if the executionAsyncId() at end-time is different than at start-time. This works for whatever `asyncHooks` config var value. Fixes: #1996
…ync (#2326) Currently `span.sync` is tracked via: - the "before" async hook setting it false on the "active" span, and - Instrumentation#bindFunction's wrapper setting it false, on the fair assumption that all usages of bindFunction are for async callbacks. The former has issues when there are multiple active spans within a single async task -- as is the case with Elasticsearch instrumentation (issue #1996) and the aws-sdk instrumentations (which have manual workarounds). This changes to set sync=false if the executionAsyncId() at end-time is different than at start-time. This decouples from async context management, so works for whatever value of the `asyncHooks` config var. This also drops the `transaction.sync` field which was never used. Fixes: #1996 Fixes: #2292
Some clearly async spans are being reported as sync, and show up in the UI as blocking. I'm not sure when this was first introduced. Here's an example:
I don't think the problem is exclusive to elasticsearch spans, I've seen it happen with custom spans as well. It seems like it was introduced in a fairly recent version of the nodejs agent:
The text was updated successfully, but these errors were encountered: