-
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
fix: ensure correct run-context for instrumented aws-sdk client usage #2472
Conversation
This fixes aws-sdk (S3, SQS, SNS) instrumentation to ensure the automatically created AWS spans do not spill into user code. This also ensures that any captured APM error for a failed AWS command is a child of the AWS span. Refs: #2430
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
…spill into user code (#2470) This fixes the 'http' and 'https' instrumentation for outgoing requests to not have the 'http' span context be active in user code. This ensures that user code cannot create a child span of the http span, which would (a) be misleading and (b) cause problems for coming exit span and compressed span work. Also, fix a bug in the https instrumentation in older versions of node (version <9.0.0) where the instrumentation of `https.request` relied on intercepting `http.request` (that Node's `https.request()` would call). The agent didn't guarantee that the 'http' module was instrumented. A user program that used `https.request` without indirectly `require('http')`ing would not get an HTTP span. Refs: #2430
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Approving -- also, re:
This also
ensures that any captured APM error for a failed AWS command is a child
of the AWS span.
Just to say this a bit more loudly, with the callback bound correct bound, the _setOutcomeFromErrorCapture
code is no longer needed captureError will now set this value on the correct span.
This fixes aws-sdk (S3, SQS, SNS) instrumentation to ensure the
automatically created AWS spans do not spill into user code. This also
ensures that any captured APM error for a failed AWS command is a child
of the AWS span.
Refs: #2430
Checklist