8000 statusCode ignored when returned as string · Issue #641 · DataDog/datadog-lambda-js · GitHub
[go: up one dir, main page]

Skip to content
statusCode ignored when returned as string #641
Closed
@thingie

Description

@thingie

Hi,
we run into an issue where we return a { statusCode: String(200) } from our lambda handler wrapped in the datadog layer, it just gets ignored and doesn't get attached to the span as an attribute as we'd expect. Now we are not quite sure what is the expected behavior, but given we have no other problems with API gateway or any other AWS service, we went to inspect the datadog code and found the following line:

} else if (resultStatusCode) {

Which doesn't make the intent on the dd side clear either, if the resultStatusCode is string already and not number, the function would just not do any explicit return. This feels to be at the odd with the code comment above the initial if statement and also the code construct is bit misleading at first sight.

Could this be clarified or fixed please? Thanks.

Expected Behavior

statusCode typed as string gets attached to the lambda handler execution span as the http.status_code attribute.

Actual Behavior

It gets silently dropped.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0