Skip to content

Error 'datadog:api key not configured' when using apiKeySecretArn #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aline-camargo opened this issue Mar 8, 2022 · 1 comment · Fixed by DataDog/datadog-lambda-js#273
Assignees
Labels
bug Something isn't working

Comments

@aline-camargo
Copy link

Expected Behavior

Sending monitoring data without logging errors, as it is configured according to documentation.

Actual Behavior

On every instance start we are getting this datadog:api key not configured error. All APM data and logs are being sent normally, but I believe this behavior of throwing error is not expected, as it was a false warning.

When I changed my code to use the apiKey parameter instead of apiKeySecretArn the error stoped showing.

Steps to Reproduce the Problem

  1. Pass the key to dd extension using the apiKeySecretArn parameter
  2. Observe the error log on every instance start

Specifications

  • Serverless Framework version: 2.72.2
  • Datadog Serverless Plugin version: 3.7.1
  • Lambda function runtime (Python 3.7, Node 10, etc.): Node 14

Stacktrace

2022-03-08T13:22:09.277Z	undefined	ERROR	{"status":"error","message":"datadog:api key not configured, see https://dtdg.co/sls-node-metrics"}

image

@tianchu tianchu added the bug Something isn't working label Mar 8, 2022
@tianchu
Copy link
Contributor

tianchu commented Mar 8, 2022

@astuyve I think we should also logDebug if this.isAgentRunning (similar to when forwarder is used, in this case, extension should check for the api key, not this library) https://github.com/DataDog/datadog-lambda-js/blob/436650bad8f544332ac45767a4b202c2ee36e312/src/metrics/listener.ts#L186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants