Tracing not working in a weird scenario #2869
Replies: 1 comment 4 replies
-
Hi @Jonathan-Chang! Maybe I need more information to try to help you. I created a scenario here and could have instrumented the Lambda with Powertools Tracer (using the Steps I did: 1 - I created an SNS Topic with an SQS Subscription and Active Tracking disabled. from aws_lambda_powertools import Tracer
from aws_lambda_powertools.utilities.typing import LambdaContext
import boto3
ec2_cli = boto3.client("ec2")
tracer = Tracer(service="xyz")
@tracer.capture_lambda_handler
def lambda_handler(event: dict, context: LambdaContext) -> str:
response = ec2_cli.describe_instances()
return response 4 - I dropped a message either in SNS or SQS and the result is the same: Can you check if you drop a message on SNS, does it get sent to SQS? I'm wondering here if it is missing setting up the Access Resource Policy in SQS to allow the SNS topic to send a message to SQS. Please send me more information to try to help you resolve this tracing issue. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am very stuck on this. I am using aws-lambda-powertools version 2.16.2
I am using the decorator, capture_lambda_handler() in my lambda.
The flow of events goes like this:
SNS -> SQS -> Lambda w/ decorator -> other services
In this flow, I expect the trace to start at the lambda but nothing gets traced.
The cloudwatch logs shows no mention of it being traced.
However, if I publish a message directly into the SQS queue, tracing works.
I see within the cloudwatch logs of my lambda: xray trace id, segmentid, sampled: true
So putting a message directly into SQS through the console activates tracing but SNS publishing a message to SQS to then get picked up by my lambda doesn't.
Any ideas?
I just want to start tracing from my Lambda forward.
Beta Was this translation helpful? Give feedback.
All reactions