I have a lambda that can be executed from various accounts. I wish to track how long the lambda executed for when executed by different accounts. AWS X-ray gives my the duration for which lambda executed by I can't corelate that information to the caller of the lambda function.
Is there a way to link the duration of execution of lambda function to caller to the function?
If you have the parameter(s) to identify the accounts on your lambda function, you may use "Annotations and metadata" feature of aws x-ray. After you make configuration it is going to be shown on your x-ray traces.
please check for official documentation
Edit: Since you are using java; you may try the example code