@instana/aws-lambda
Advanced tools
Comparing version 1.74.1 to 1.74.2
{ | ||
"name": "@instana/aws-lambda", | ||
"version": "1.74.1", | ||
"version": "1.74.2", | ||
"description": "Monitor Node.js based AWS Lambdas with Instana", | ||
@@ -60,3 +60,3 @@ "author": { | ||
"dependencies": { | ||
"@instana/core": "^1.74.1", | ||
"@instana/core": "^1.74.2", | ||
"semver": "^5.6.0" | ||
@@ -74,3 +74,3 @@ }, | ||
}, | ||
"gitHead": "29b972d18474e101f4af91bf3c1b5f7fc12fa08f" | ||
"gitHead": "de6e7ec86045ab2482587d2564d36d4ee836b6ee" | ||
} |
@@ -89,3 +89,3 @@ 'use strict'; | ||
[constants.xInstanaHost]: identityProvider ? identityProvider.getHostHeader() : 'nodejs-aws-lambda', | ||
[constants.xInstanaKey]: environmentUtil.getInstanaKey(), | ||
[constants.xInstanaKey]: environmentUtil.getInstanaAgentKey(), | ||
[constants.xInstanaTime]: Date.now() | ||
@@ -92,0 +92,0 @@ }, |
@@ -16,4 +16,7 @@ 'use strict'; | ||
const instanaUrlEnvVar = 'INSTANA_URL'; | ||
const instanaKeyEnvVar = 'INSTANA_KEY'; | ||
const instanaEndpointUrlEnvVar = 'INSTANA_ENDPOINT_URL'; | ||
const instanaAgentKeyEnvVar = 'INSTANA_AGENT_KEY'; | ||
// The following two environment variables are deprecated and will be removed soon. | ||
const deprecatedInstanaUrlEnvVar = 'INSTANA_URL'; | ||
const deprecatedInstanaKeyEnvVar = 'INSTANA_KEY'; | ||
let valid = false; | ||
@@ -23,3 +26,3 @@ let backendHost = null; | ||
let backendPath = null; | ||
let instanaKey = null; | ||
let instanaAgentKey = null; | ||
@@ -30,3 +33,6 @@ exports.sendUnencryptedEnvVar = 'INSTANA_DEV_SEND_UNENCRYPTED'; | ||
exports.validate = function validate() { | ||
exports._validate(process.env[instanaUrlEnvVar], process.env[instanaKeyEnvVar]); | ||
exports._validate( | ||
process.env[instanaEndpointUrlEnvVar] || process.env[deprecatedInstanaUrlEnvVar], | ||
process.env[instanaAgentKeyEnvVar] || process.env[deprecatedInstanaKeyEnvVar] | ||
); | ||
}; | ||
@@ -42,15 +48,15 @@ | ||
// exposed for testing | ||
exports._validate = function _validate(instanaUrl, _instanaKey) { | ||
logger.debug(`${instanaUrlEnvVar}: ${instanaUrl}`); | ||
exports._validate = function _validate(instanaEndpointUrl, _instanaAgentKey) { | ||
logger.debug(`${instanaEndpointUrlEnvVar}: ${instanaEndpointUrl}`); | ||
if (!instanaUrl) { | ||
logger.warn(`${instanaUrlEnvVar} is not set. No data will be reported to Instana.`); | ||
if (!instanaEndpointUrl) { | ||
logger.warn(`${instanaEndpointUrlEnvVar} is not set. No data will be reported to Instana.`); | ||
return; | ||
} | ||
const parsedUrl = parseUrl(instanaUrl); | ||
const parsedUrl = parseUrl(instanaEndpointUrl); | ||
if (!parsedUrl) { | ||
logger.warn( | ||
`The value of ${instanaUrlEnvVar} (${instanaUrl}) does not seem to be a well-formed URL.` + | ||
`The value of ${instanaEndpointUrlEnvVar} (${instanaEndpointUrl}) does not seem to be a well-formed URL.` + | ||
' No data will be reported to Instana.' | ||
@@ -63,4 +69,4 @@ ); | ||
logger.warn( | ||
`The value of ${instanaUrlEnvVar} (${instanaUrl}) specifies a non-supported protocol: "${parsedUrl.protocol}".` + | ||
' Only "https:" is supported. No data will be reported to Instana.' | ||
`The value of ${instanaEndpointUrlEnvVar} (${instanaEndpointUrl}) specifies a non-supported protocol: ` + | ||
`"${parsedUrl.protocol}". Only "https:" is supported. No data will be reported to Instana.` | ||
); | ||
@@ -71,4 +77,4 @@ return; | ||
logger.warn( | ||
`The value of ${instanaUrlEnvVar} (${instanaUrl}) specifies a non-supported protocol: "${parsedUrl.protocol}".` + | ||
' Only "https:" and "http:" are supported. No data will be reported to Instana.' | ||
`The value of ${instanaEndpointUrlEnvVar} (${instanaEndpointUrl}) specifies a non-supported protocol: ` + | ||
`"${parsedUrl.protocol}". Only "https:" and "http:" are supported. No data will be reported to Instana.` | ||
); | ||
@@ -80,3 +86,3 @@ return; | ||
logger.warn( | ||
`The value of ${instanaUrlEnvVar} (${instanaUrl}) does not seem to be a well-formed URL.` + | ||
`The value of ${instanaEndpointUrlEnvVar} (${instanaEndpointUrl}) does not seem to be a well-formed URL.` + | ||
' No data will be reported to Instana.' | ||
@@ -95,13 +101,13 @@ ); | ||
instanaKey = _instanaKey; | ||
instanaAgentKey = _instanaAgentKey; | ||
if (!instanaKey || instanaKey.length === 0) { | ||
logger.warn(`The environment variable ${instanaKeyEnvVar} is not set. No data will be reported to Instana.`); | ||
if (!instanaAgentKey || instanaAgentKey.length === 0) { | ||
logger.warn(`The environment variable ${instanaAgentKeyEnvVar} is not set. No data will be reported to Instana.`); | ||
return; | ||
} | ||
logger.debug(`INSTANA HOST: ${backendHost}`); | ||
logger.debug(`INSTANA PORT: ${backendPort}`); | ||
logger.debug(`INSTANA PATH: ${backendPath}`); | ||
logger.debug(`INSTANA KEY: ${instanaKey}`); | ||
logger.debug(`INSTANA ENDPOINT HOST: ${backendHost}`); | ||
logger.debug(`INSTANA ENDPOINT PORT: ${backendPort}`); | ||
logger.debug(`INSTANA ENDPOINT PATH: ${backendPath}`); | ||
logger.debug(`INSTANA AGENT KEY: ${instanaAgentKey}`); | ||
valid = true; | ||
@@ -126,4 +132,4 @@ }; | ||
exports.getInstanaKey = function getInstanaKey() { | ||
return instanaKey; | ||
exports.getInstanaAgentKey = function getInstanaAgentKey() { | ||
return instanaAgentKey; | ||
}; | ||
@@ -130,0 +136,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
33566
810
18
13
Updated@instana/core@^1.74.2