-
Notifications
You must be signed in to change notification settings - Fork 406
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
Bug: Tracing is not working when Event Source decorator is used #4303
Comments
Hi @SZubarev, thanks for opening this issue and reporting what may be a bug. I was trying to reproduce this error but I couldn't. Following the steps I did to reproduce. Can you please provide a minimal and reproducible code and payload? codefrom aws_lambda_powertools import Tracer
from aws_lambda_powertools.utilities.data_classes import event_source, EventBridgeEvent
tracer = Tracer()
@tracer.capture_lambda_handler
@event_source(data_class=EventBridgeEvent)
def lambda_handler(event: EventBridgeEvent, context):
print("time ---->", event.time)
return "OK" payload{
"version": "0",
"id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "111122223333",
"time": "2017-12-22T18:43:48Z",
"region": "us-west-1",
"resources": [
"arn:aws:ec2:us-west-1:123456789012:instance/i-1234567890abcdef0"
],
"detail": {
"instance_id": "i-1234567890abcdef0",
"state": "terminated"
},
"replay-name": "replay_archive"
} execution resultTest Event Name
zsas
Response
"OK"
Function Logs
START RequestId: 25dd6166-850a-4a8f-8934-8fa73846a51f Version: $LATEST
time ----> 2017-12-22T18:43:48Z
END RequestId: 25dd6166-850a-4a8f-8934-8fa73846a51f
REPORT RequestId: 25dd6166-850a-4a8f-8934-8fa73846a51f Duration: 4.09 ms Billed Duration: 4 ms Memory Size: 128 MB Max Memory Used: 63 MB Init Duration: 527.00 ms
XRAY TraceId: 1-663d4990-18d87888009633dd6dae583a SegmentId: f5914f9d61cd9bac Sampled: true
Request ID
25dd6166-850a-4a8f-8934-8fa73846a51f TraceThanks |
Root cause was event sourcing from Amazon MQ which doesn't provide XRay headers to request when sending messages to lambda. Closing. |
|
Expected Behaviour
If I add
@tracer
decorator the X-Ray tracing should workCurrent Behaviour
If
@tracer
decorator is used together with@event_source
decorator X-Ray tracing is not working.Also original X-Ray SDK decorator
@xray_recorder.capture()
not working if@event_source
decorator is used.Code snippet
The text was updated successfully, but these errors were encountered: