[SVLS-8231] fixing log requestId for LMI by jchrostek-dd · Pull Request #973 · DataDog/datadog-lambda-extension
https://datadoghq.atlassian.net/browse/SVLS-8231
Overview
- Bug fix - When running a LMI function, function logs don't get attributed with
lambda.requestId. As a result, no function logs appear for an invocation. They still show up for the function, just not not on the invocation. - We could have alternatively updated the UI to search for
lambda.requestIdandrequestIdinstead of just searching forlambda.requestId. However, I would prefer for On Demand and Lambda Managed Instance Functions to be consistent. So, both using lambda.requestId is preferred.
Testing
- Added integration tests that checks for logs per invocation request.
- Also confirmed in the UI we are seeing the logs for an invocation (before/after screenshot below).
Comment on lines +111 to +116
| if is_oom_error(&message) { | ||
| debug!("LOGS | Got a runtime-specific OOM error. Incrementing OOM metric."); | ||
| if let Err(e) = self.event_bus.send(Event::OutOfMemory(event.time.timestamp())).await { | ||
| error!("LOGS | Failed to send OOM event to the main event bus: {e}"); | ||
| } | ||
| } |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can delete the if is_oom_error(&message) {} block in the TelemetryRecord::Extension case below. I think runtime-specific OOM errors can only come from the function.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to validate that? I would have though that extensions can also have an OOM error.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave for now to be safe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

