@opentelemetry/instrumentation-aws-lambda
Advanced tools
Comparing version 0.43.0 to 0.44.0
@@ -5,8 +5,6 @@ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation'; | ||
export declare const traceContextEnvironmentKey = "_X_AMZN_TRACE_ID"; | ||
export declare class AwsLambdaInstrumentation extends InstrumentationBase { | ||
export declare class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstrumentationConfig> { | ||
private _traceForceFlusher?; | ||
private _metricForceFlusher?; | ||
protected _config: AwsLambdaInstrumentationConfig; | ||
constructor(config?: AwsLambdaInstrumentationConfig); | ||
setConfig(config?: AwsLambdaInstrumentationConfig): void; | ||
init(): InstrumentationNodeModuleDefinition[]; | ||
@@ -13,0 +11,0 @@ private _getHandler; |
@@ -39,18 +39,15 @@ "use strict"; | ||
constructor(config = {}) { | ||
super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); | ||
if (this._config.disableAwsContextPropagation == null) { | ||
if (config.disableAwsContextPropagation == null) { | ||
if (typeof process_1.env['OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION'] === | ||
'string' && | ||
process_1.env['OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION'].toLocaleLowerCase() === 'true') { | ||
this._config.disableAwsContextPropagation = true; | ||
config = Object.assign(Object.assign({}, config), { disableAwsContextPropagation: true }); | ||
} | ||
} | ||
super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); | ||
} | ||
setConfig(config = {}) { | ||
this._config = config; | ||
} | ||
init() { | ||
var _a; | ||
const taskRoot = process.env.LAMBDA_TASK_ROOT; | ||
const handlerDef = (_a = this._config.lambdaHandler) !== null && _a !== void 0 ? _a : process.env._HANDLER; | ||
const handlerDef = (_a = this.getConfig().lambdaHandler) !== null && _a !== void 0 ? _a : process.env._HANDLER; | ||
// _HANDLER and LAMBDA_TASK_ROOT are always defined in Lambda but guard bail out if in the future this changes. | ||
@@ -118,3 +115,3 @@ if (!taskRoot || !handlerDef) { | ||
event, context, callback) { | ||
const config = plugin._config; | ||
const config = plugin.getConfig(); | ||
const parent = AwsLambdaInstrumentation._determineParent(event, context, config.disableAwsContextPropagation === true, config.eventContextExtractor || | ||
@@ -131,4 +128,5 @@ AwsLambdaInstrumentation._defaultEventContextExtractor); | ||
}, parent); | ||
if (config.requestHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => config.requestHook(span, { event, context }), e => { | ||
const { requestHook } = config; | ||
if (requestHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { event, context }), e => { | ||
if (e) | ||
@@ -240,5 +238,5 @@ api_1.diag.error('aws-lambda instrumentation: requestHook error', e); | ||
_applyResponseHook(span, err, res) { | ||
var _a; | ||
if ((_a = this._config) === null || _a === void 0 ? void 0 : _a.responseHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => this._config.responseHook(span, { err, res }), e => { | ||
const { responseHook } = this.getConfig(); | ||
if (responseHook) { | ||
(0, instrumentation_1.safeExecuteInTheMiddle)(() => responseHook(span, { err, res }), e => { | ||
if (e) | ||
@@ -245,0 +243,0 @@ api_1.diag.error('aws-lambda instrumentation: responseHook error', e); |
@@ -1,3 +0,3 @@ | ||
export declare const PACKAGE_VERSION = "0.43.0"; | ||
export declare const PACKAGE_VERSION = "0.44.0"; | ||
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-aws-lambda"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,4 +20,4 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.PACKAGE_VERSION = '0.43.0'; | ||
exports.PACKAGE_VERSION = '0.44.0'; | ||
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-aws-lambda'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-aws-lambda", | ||
"version": "0.43.0", | ||
"version": "0.44.0", | ||
"description": "OpenTelemetry instrumentation for AWS Lambda function invocations", | ||
@@ -55,3 +55,3 @@ "main": "build/src/index.js", | ||
"nyc": "15.1.0", | ||
"rimraf": "5.0.5", | ||
"rimraf": "5.0.10", | ||
"ts-mocha": "10.0.0", | ||
@@ -61,10 +61,10 @@ "typescript": "4.4.4" | ||
"dependencies": { | ||
"@opentelemetry/instrumentation": "^0.52.0", | ||
"@opentelemetry/instrumentation": "^0.53.0", | ||
"@opentelemetry/propagator-aws-xray": "^1.3.1", | ||
"@opentelemetry/resources": "^1.8.0", | ||
"@opentelemetry/semantic-conventions": "^1.22.0", | ||
"@types/aws-lambda": "8.10.122" | ||
"@opentelemetry/semantic-conventions": "^1.27.0", | ||
"@types/aws-lambda": "8.10.143" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-aws-lambda#readme", | ||
"gitHead": "ad8436d6a4174f2288cb939080cd4e74da94b0d7" | ||
"gitHead": "9dc58afed8134f95908331bcff35c5d9ec46fe9a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
66891
404
+ Added@opentelemetry/api-logs@0.53.0(transitive)
+ Added@opentelemetry/instrumentation@0.53.0(transitive)
+ Added@types/aws-lambda@8.10.143(transitive)
- Removed@opentelemetry/api-logs@0.52.1(transitive)
- Removed@opentelemetry/instrumentation@0.52.1(transitive)
- Removed@types/aws-lambda@8.10.122(transitive)
Updated@types/aws-lambda@8.10.143