Comments (2)
Hi @jasonterando, thanks for contributing this instrumentation! The implementation looks good so far, I think it's on the right track and follows the structure of the current instrumentations in this package. The main point I wanted to call out was the possibility of supporting the new fetch API as well as node-fetch, which I see you were one step ahead on :)
Not sure if you had the time to skim through some of the automatic vs. manual mode documentation we have, so I'll leave a few references that would hopefully help clarify the difference. There's a simple explanation in the express package that says:
The AWS X-Ray SDK Core has two modes - manual and automatic.
Automatic mode uses the cls-hooked package and automatically tracks the current
segment and subsegment. This is the default mode.
Manual mode requires that you pass around the segment reference.
References:
- cls-hooked package docs (used in automatic mode to create/update/maintain context. This allows for retrieving the current segment at any time, for example, using
AWSXRay.getSegment()
, since it is stored in the context created using the cls-hooked package. These docs have a few simple examples on how context works behind the scenes. The idea is, in manual mode (with no context), you would have to manually mimic the behavior of a context by setting the current segment yourself so that the SDK knows which segment is currently active. - X-Ray Node SDK docs
a. Automatic and manual mode
b. Developing custom solutions using automatic mode
c. Capture subsegments within chained native Promise using automatic mode. There is a PR linked in this section which has some very interesting discussions regarding the axios instrumentation and the way cls-hooked handles Promises (which is very important for fetch/node-fetch)
d. Automatic mode examples
e. Manual mode examples
Hope this helps, please feel free to ask any follow-up questions on this issue. Looking forward to the PR!
from aws-xray-sdk-node.
Ok, after reading through the links you sent, I think I have something that's workable. I've submitted a PR, but your pipelines are very angry about Lerna on any NodeJS version past 14. If I need to adjust package.json (or anything else) let me know.
from aws-xray-sdk-node.
Related Issues (20)
- Size of the aws-xray-sdk-core package dependencies (i.e. the bundle) HOT 1
- memory leaks caused by cls-hooked HOT 3
- Vulnerability in the library HOT 6
- Adding custom attributes to AWS SDK v3 calls HOT 2
- Please update readme for postgres
- captureAWSv3Client doesn't support SecretManager client HOT 3
- Add support for the lamda-api web framework
- captureAsyncFunc is not working for AWS Lambda with runtime nodejs 16 HOT 1
- Release 3.5.2 HOT 2
- Segment containing BigInt in metadata throws an error when serialized HOT 2
- Cannot find module 'aws-xray-sdk' in nodejs Lambda
- warning message @aws-sdk/service-error-classification is moved to @smithy/service-error-classification
- Support undici HOT 1
- Consider supporting SQL annotations for Athena calls. HOT 1
- Feature Request | ServiceMap in X-Ray Tracing does not show EventBridge and SQS
- Creating Linked Traces between SQS Producer and Consumer on Non Serverless Compute HOT 2
- Is there any way how to use XRay instrumentation for AWS NodeJS SDK v3? I have the below HOT 2
- SimulatePrincipalpolicy:: Python SDK does not work with regular expressions HOT 1
- Wrong link to the sdk contrib readmes HOT 1
- fetch with URL object fails with `Cannot read properties of undefined (reading 'has')`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-xray-sdk-node.