Open revmischa opened 2 years ago
Hi @revmischa thank you for taking the time to open a feature request.
As I have briefly mentioned on Discord: at the moment we don't use any of the middleware
features from aws-xray-sdk
so I'm unsure on how it will behave with Tracer. With that said, a first cursory look at traceRequestResponseCycle
's implementation suggests that the utility provides some syntactic sugar around segment manipulation/annotation, which bodes well for Powertools compatibility.
Before considering the feature and putting it into the backlog, I would like some investigation to take place to make a small PoC and understand the impact and compatibility of this feature with Powertools.
Like with all features, contributions are more than welcome, and in case this is left to the maintainers, having 👍 on the feature request will help increasing its priority in our backlog.
If anyone is interested in picking up this issue, please leave a comment below to express your interest and agree on next steps. The maintainers will be happy to support you with clearing doubts or questions on the scope and codebase.
For my purposes a simpler version of this would be to let me manually set the HTTP path, method, status code directly on the segment. But I have no idea how to do this and couldn't find any documentation on how to manually set those attributes.
this is https://www.npmjs.com/package/aws-xray-sdk-express feature, this is very useful when we are tracing some ip address or api URL in a easy way
FYI @revmischa, I have been looking at the aws-sdk-for-nodejs
implementation to see if I could find a way to make it work for Tracer without changes but didn't have much luck.
I'll keep looking, also using the example that was just posted above.
This issue has not received a response in 2 weeks. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
Please keep open
This issue has not received a response in 2 weeks. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
Use case
I have a nextjs CDK construct with a simple APIGW lambda wrapper around nextjs. I want to annotate my traces with HTTP request and response metadata, e.g. "URL" and "method" and "status code"
I would like to use it here: https://github.com/jetbridge/cdk-nextjs/blob/main/assets/lambda/NextJsHandler.ts#L45
I'd like to see the status code, path, method, etc in xray:
Solution/User Experience
Perhaps something like
traceRequestResponseCycle
in https://docs.aws.amazon.com/xray-sdk-for-nodejs/latest/reference/AWSXRay.htmlAlternative solutions
Acknowledgment