Description
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:
datadog-lambda-js/src/trace/trigger.ts
Line 394 in 2f9c1e8
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.