-
Notifications
You must be signed in to change notification settings - Fork 158
Closed
Labels
Description
I have two microservices namely user-service
and notification-service
, whenever user sign-up to user-service
. the message will add to sqs queue with AWSTraceHeader
, now from notification-service
sqs-consumer will poll and pass that message to handleMessage callback function and send an email to enduser using SES.
I can able to trace the process till, user-service ---> sqs
queue, but how can traceId entire flow like user-service->queue->notification-service->ses
. I tried the following code
handleMessage: async (message: SQS.Message) => {
const segment = AWSXRay.getSegment()
if(segment){
segment.trace_id = message.Attributes?.AWSTraceHeader
}
await wiring.sqsService.handleMessage(message);
}
but got the error like below
Property 'trace_id' does not exist on type 'Segment | Subsegment'. Property 'trace_id' does not exist on type 'Subsegment'.
How can I trace the entire process?