DataDog/datadog-lambda-js

A BadRequest response from the API logs `authorization failed...`

Czechh opened this issue ยท 3 comments

Expected Behavior

On a BadParam Error from the API, don't log that there is an authorization failure.

Actual Behavior

On a BadParam Error from the API we log the following line https://github.com/DataDog/datadog-lambda-js/blob/main/src/metrics/api.ts#L28 - as this check puts the response in the same bucket https://github.com/DataDog/datadog-lambda-js/blob/main/src/utils/request.ts#L56.

So the request is rejected with a BadAuth

Steps to Reproduce the Problem

  1. Turn on debug mode
  2. Send a malformed metric
  3. Check the logs

Specifications

  • Datadog Lambda Layer version: 3.49.1
  • Node version: 14.x

๐Ÿ‘‹

@nhinsch You mind owning this one?

This should be fixed by #210

The change will be included in the next release of the library.