Skip to content

Commit

Permalink
fix(lambda): changed memory warning when using the lambda extension (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kirrg001 authored Sep 27, 2024
1 parent 2fd0a91 commit 3e94f9e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions packages/aws-lambda/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,28 @@ function shouldUseLambdaExtension() {
return false;
}
if (memorySize < 256) {
logger.debug(
let logFn = logger.debug;

// CASE: We try to determine if the customer has the extension installed. We need to put a warning
// because the extension is **not** working and might block the lambda extension when
// its not used correctly e.g. slow startup of extension or waiting for invokes or incoming spans
// from the tracer.
if (process.env._HANDLER?.includes('instana-aws-lambda-auto-wrap')) {
logFn = logger.warn;
}

logFn(
'The Lambda function is configured with less than 256 MB of memory according to the value of ' +
`AWS_LAMBDA_FUNCTION_MEMORY_SIZE: ${memorySetting}. Offloading data via a Lambda extension does currently ` +
'not work reliably with low memory settings, therefore not using the Lambda extension.'
`AWS_LAMBDA_FUNCTION_MEMORY_SIZE: ${memorySetting}. The Lambda extension does ` +
'not work with 256mb reliably with low memory settings. ' +
'As the extension is already running, it might ' +
'block the lambda execution which can result in larger execution times. Please configure at least ' +
'256 MB of memory for your Lambda function.'
);

return false;
}

return true;
}
}
Expand Down

0 comments on commit 3e94f9e

Please sign in to comment.