The idea is the following:
- Codecommit has a notification rule.
- Notification's target it's an sns topic.
- The topic's target is a lambda function.
- Minimally I want lambda X-Ray trace when the notification occurs. If all trace better.
I post a message from the SNS Topic console, the X-Ray trace is generated with SNS and Lambda.
However, if I trigger a notification, the trace is not generated (Lambda runs correctly).
I would like to know if I can make the complete or partial trace be generated when generating a notification in CodeCommit.
Update
My lambda logs insights:
- Post message from SNS Topic:
"_X_AMZN_TRACE_ID": "Root=1-62gd6bfa-6ag9233f49fe8faf6ef7ed16;Parent=4b19513e742ad199;Sampled=1"
- Codecommit notification:
"_X_AMZN_TRACE_ID": "Root=1-62d56c36-3bg3f6fbaa075b171b9fdba6;Parent=2f5f68ffyf25388e;Sampled=0"
My lambda Function has active tracing, and has permissions, but I don't know why the second case don't get sampled. It should be tracing all the invocations, being sampled or not sampled...
AWS CodeCommit is not yet integrated with X-Ray, so it will not generate or propagate a trace on the SNS notifications it is generating. However, since Lambda is fully integrated you should see a trace with a Lambda node every time it is invoked, either through CodeCommit notification or via the SNS Topic console. Is that not the case? Can you print the value for
_X_AMZN_TRACE_ID
environment variable in your Lambda function and see if the trace id is being generated properly and is being sampled?