@instana/aws-lambda
Advanced tools
Comparing version 1.120.0 to 1.121.0
{ | ||
"name": "@instana/aws-lambda", | ||
"version": "1.120.0", | ||
"version": "1.121.0", | ||
"description": "Instana tracing and monitoring for Node.js based AWS Lambdas", | ||
@@ -60,4 +60,4 @@ "author": { | ||
"dependencies": { | ||
"@instana/core": "1.120.0", | ||
"@instana/serverless": "1.120.0" | ||
"@instana/core": "1.121.0", | ||
"@instana/serverless": "1.121.0" | ||
}, | ||
@@ -74,3 +74,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "0d989dde80dd3ea7afc37a81da4db71e1c207c04" | ||
"gitHead": "9e0e2e41fd4e6ec4bb30d04a833314e45edfd768" | ||
} |
@@ -209,4 +209,14 @@ /* | ||
identityProvider.init(arnInfo); | ||
backendConnector.init(identityProvider, logger, true, false, 500); | ||
const useLambdaExtension = shouldUseLambdaExtension(); | ||
if (useLambdaExtension) { | ||
logger.info('@instana/aws-lambda will use the Instana Lambda extension to send data to the Instana back end.'); | ||
} else { | ||
logger.info( | ||
'@instana/aws-lambda will not use the Instana Lambda extension, but instead send data to the Instana back end ' + | ||
'directly.' | ||
); | ||
} | ||
backendConnector.init(identityProvider, logger, true, false, 500, useLambdaExtension); | ||
// instanaCore.init also normalizes the config as a side effect | ||
@@ -221,2 +231,34 @@ instanaCore.init(config, backendConnector, identityProvider); | ||
function shouldUseLambdaExtension() { | ||
if (process.env.INSTANA_DISABLE_LAMBDA_EXTENSION) { | ||
logger.info('INSTANA_DISABLE_LAMBDA_EXTENSION is set, not using the Lambda extension.'); | ||
return false; | ||
} else { | ||
const memorySetting = process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE; | ||
if (!memorySetting) { | ||
logger.debug( | ||
'The environment variable AWS_LAMBDA_FUNCTION_MEMORY_SIZE is not present, cannot determine memory settings.' | ||
); | ||
return true; | ||
} | ||
const memorySize = parseInt(memorySetting, 10); | ||
if (isNaN(memorySize)) { | ||
logger.debug( | ||
`Could not parse the value of the environment variable AWS_LAMBDA_FUNCTION_MEMORY_SIZE: "${memorySetting}", ` + | ||
'cannot determine memory settings, not using the Lambda extension.' | ||
); | ||
return false; | ||
} | ||
if (memorySize < 256) { | ||
logger.debug( | ||
'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.' | ||
); | ||
return false; | ||
} | ||
return true; | ||
} | ||
} | ||
/** | ||
@@ -223,0 +265,0 @@ * Code to be executed after the promise returned by the original handler has completed. |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
36366
857
6
+ Added@instana/core@1.121.0(transitive)
- Removed@instana/core@1.120.0(transitive)
Updated@instana/core@1.121.0
Updated@instana/serverless@1.121.0