elastic / elastic/apm-agent-nodejs

lambda: `context.fail()` without passing an error will result in trans.{result,outcome} being set to success

Open
#2,581 0 comments 0 reactions 0 assignees View on GitHub
agent-nodejs
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

The Lambda `context.fail(...)` method's `err` argument is optional:
https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/blob/c31c41ffe5f2f03ae9e8589b96f3b005e2bb8a4a/src/Runtime/CallbackContext.ts#L108-L114

In our current instrumentation `endAndFlushTransaction` will misinterpret that as a success, and set `trans.result` and `trans.outcome` to success values.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.