Skip to content
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

Is it possible to pass in a client side created traceId to the backend XRay capture so that it uses the supplied TraceId #674

Closed
shaundclements opened this issue Aug 23, 2024 · 3 comments

Comments

@shaundclements
Copy link

Im trying to link up all related downstream processes with a TraceId that is created in the frontend code and passed to all backend calls.
Is there a way to pass this traceId guid into the AWSXRay client capture methods ?

@shaundclements shaundclements changed the title Is it possible to pass in a client side created traceId to the backend XRay capture so that is uses the supplied TraceId Is it possible to pass in a client side created traceId to the backend XRay capture so that it uses the supplied TraceId Aug 23, 2024
@thpierce
Copy link
Contributor

Hi @shaundclements, thanks for reaching out. Just trying to understand the situation and your question. As I understand it you have a front-end service and a backend service, both (?) are using the X-Ray Node SDK, and you want a consistent traceId to be used from fronted to backend. Can you clarify:

  1. What framework are you using for the frontend and backend services?
  2. Does the frontend directly call the backend with some client? If so, what client is used? If not, how is information transmitted to the backend?
  3. Does the frontend only ever invoke the backend if a frontend API is invoked (e.g. the only path is FrontEnd API call -> Backend API call (or other transmission, see question 2).

@shaundclements
Copy link
Author

shaundclements commented Aug 29, 2024

  1. typescript
  2. It can be a mix of http requests to backend APIs and AWS services from a react client
  3. I am specifically after client invoked/initiated tracing rather than tracing starting from separate backend APIs. A client might request more than one service in a workflow of actions. If I was to add an http client capture for each http request, what would tie the two together? Is there a way to pass the traceId into the second http client capture or would it generate a new traceId ?

@shaundclements
Copy link
Author

Just adding for reference here, I have been advised by @mxiamxia to use OpenTelemetry SDK for client invoke tracing, ref: https://opentelemetry.io/docs/demo/services/frontend rather than trying to find a way in XRay Node SDK to do this so current feature around linking traces is not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants