aws-samples/aws-lambda-extensions

Capture request id for all events.

bhavyalatha26 opened this issue · 1 comments

Hi Team,

Thank you for the samples. They were very helpful to get started.

When listening to logs from Logs API, not all logs have the equest id information within them. Only certain platform events seem to have the request id information.

Is there a way to capture request id for all events ? The lambda context usually has the request id info, is there a way to pass the lambda's context object to the extension ?

At the moment, I try to capture request id from the platform start event and add it to all messages, but the request id seems to mixup, when the collected stream of logs have logs from 2 different invocations

Regards,
Bhavya.

Hi, you'll need to use language specific loggers to add request id (which is available in context object) to your function logs. We don't modify customer logs (to add requestID) because it could mess with your log pipelines, break your parsers, etc. Once its in your function logs, you'll see it in the logs streamed by the logs API.