dbader/node-datadog-metrics

Getting 403 after putting in DATADOG_API_KEY

pjerryhu opened this issue · 4 comments

Hey guys, I followed the guide https://www.npmjs.com/package/datadog-metrics
and integrated the lib but still getting 403 after putting in my DATADOG_API_KEY. Do you guys have clues on how to resolve this??

metrics: ERROR: failed to send metrics (err=ApiException [Error]: HTTP-Code: 403
Message: {"errors":["Forbidden"],"additionalProperties":{"status":"error","code":403,"statuspage":"http://status.datadoghq.com","twitter":"http://twitter.com/datadogops","email":"support@datadoghq.com"}}
    at MetricsApiResponseProcessor.eval (webpack-internal:///(api)/../../node_modules/.pnpm/@datadog+datadog-api-client@1.24.0/node_modules/@datadog/datadog-api-client/dist/packages/datadog-api-client-v1/apis/MetricsApi.js:458:23)
    at Generator.next (<anonymous>)
    at fulfilled (webpack-internal:///(api)/../../node_modules/.pnpm/@datadog+datadog-api-client@1.24.0/node_modules/@datadog/datadog-api-client/dist/packages/datadog-api-client-v1/apis/MetricsApi.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 403,
  body: [APIErrorResponse]
})

no worries, got it working

@pjerryhu Can I ask what the issue turned out to be? Is there anything that could or should have been better in the docs or error messages to help you solve it before you wound up posting an issue?

Hi @Mr0grog , thanks for the message. Yea, it turned out Datadog has App Key and API key as 2 different concepts.. I was just generating an App Key and use it for the API key.

Good to know. I’ll see if we can clarify this some in the docs or maybe add a suggestion about this in the error message.