Skip to content
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

Getting 403 after putting in DATADOG_API_KEY #115

Closed
pjerryhu opened this issue Apr 11, 2024 · 4 comments
Closed

Getting 403 after putting in DATADOG_API_KEY #115

pjerryhu opened this issue Apr 11, 2024 · 4 comments

Comments

@pjerryhu
Copy link

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":"[email protected]"}}
    at MetricsApiResponseProcessor.eval (webpack-internal:///(api)/../../node_modules/.pnpm/@[email protected]/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/@[email protected]/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]
})
@pjerryhu
Copy link
Author

no worries, got it working

@Mr0grog
Copy link
Collaborator

Mr0grog commented Apr 12, 2024

@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?

@pjerryhu
Copy link
Author

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.

@Mr0grog
Copy link
Collaborator

Mr0grog commented Apr 16, 2024

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.

Mr0grog added a commit that referenced this issue Jun 22, 2024
Issue #115 demonstrated how easy it is to get confused about API vs. application keys, so I’ve added some more documentation here about the difference as well as links to the official documentation about it (https://docs.datadoghq.com/account_management/api-app-keys/).

I’ve also added a custom `AuthorizationError` class with a more explanatory message (also with links to the docs), so people should see something more helpful in their console or logs, too.
Mr0grog added a commit that referenced this issue Jun 25, 2024
Issue #115 demonstrated how easy it is to get confused about API vs. application keys, so I’ve added some more documentation here about the difference as well as links to the official documentation about it (https://docs.datadoghq.com/account_management/api-app-keys/).

I’ve also added a custom `AuthorizationError` class with a more explanatory message (also with links to the docs), so people should see something more helpful in their console or logs, too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants