You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: datadog-api-client Failing with ETIMEDOUT, Direct API Calls Work
Description
I am facing an issue where API requests made using datadog-api-client fail with a timeout error (ETIMEDOUT) only on my deployed server. However, when I make direct API calls using Axios (e.g., https://api.datadoghq.com/api/v1/dashboard), it works fine.
Observations
The issue only happens with datadog-api-client.
Direct API calls using Axios work fine.
Works locally, but fails when deployed.
Seems to be a connection issue (ETIMEDOUT), but only with the client library.
Expected Behavior
Requests using datadog-api-client should work in both local and deployed environments, just like direct API calls.
Steps to Reproduce
Deploy the application to a server.
Attempt to fetch cluster metrics using datadog-api-client.
Observe the timeout error.
Try the same request using Axios → Works fine.
Possible Causes
Proxy or network configuration: The client library might be using a proxy or network setting that causes issues on the server.
TLS or library-specific networking issues.
Different default timeouts or retry mechanisms in datadog-api-client vs. Axios.
Node.js version mismatch: The deployed environment may have a different version of Node.js affecting the behavior.
Workaround (Works with Axios)
const axios = require('axios');
axios.get('https://api.datadoghq.com/api/v1/dashboard', {
headers: {
'DD-API-KEY': 'xxx',
'DD-APPLICATION-KEY': 'xxx'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
This works fine, but datadog-api-client still fails.
Request for Help
Are there any known issues with datadog-api-client in a deployed environment?
Is there a recommended way to debug or configure the client for better connectivity?
Any guidance would be greatly appreciated. Thanks! 🙏
The text was updated successfully, but these errors were encountered:
We're not aware of any issues using the datadog-api-client-typescript package in a deployed environment. It could be an issue with some outgoing traffic configuration on your server.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.
If you would like this issue to remain open:
Verify that you can still reproduce the issue in the latest version of this project.
Comment that the issue is still reproducible and include updated details requested in the issue template.
Issue: datadog-api-client Failing with ETIMEDOUT, Direct API Calls Work
Description
I am facing an issue where API requests made using datadog-api-client fail with a timeout error (ETIMEDOUT) only on my deployed server. However, when I make direct API calls using Axios (e.g., https://api.datadoghq.com/api/v1/dashboard), it works fine.
Error fetching cluster metrics: FetchError: request to https://api.datadoghq.com/api/v1/query?from=1740660092&to=1740660152&query=sum%3Akubernetes.cpu.requests%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Akubernetes.cpu.limits%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Akubernetes.cpu.usage.total%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Akubernetes.memory.requests%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Akubernetes.memory.limits%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Akubernetes.memory.usage%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Asystem.cpu.num_cores%7B*%7D+by+%7Bcluster_name%7D%2C+avg%3Asystem.cpu.idle%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Asystem.mem.total%7B*%7D+by+%7Bcluster_name%7D%2C+sum%3Asystem.mem.free%7B*%7D+by+%7Bcluster_name%7D failed, reason: connect ETIMEDOUT 3.233.153.176:443
at ClientRequest. (/home/monitoring/app/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (events.js:400:28)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
Observations
The issue only happens with datadog-api-client.
Direct API calls using Axios work fine.
Works locally, but fails when deployed.
Seems to be a connection issue (ETIMEDOUT), but only with the client library.
Expected Behavior
Requests using datadog-api-client should work in both local and deployed environments, just like direct API calls.
Steps to Reproduce
Deploy the application to a server.
Attempt to fetch cluster metrics using datadog-api-client.
Observe the timeout error.
Try the same request using Axios → Works fine.
Possible Causes
Proxy or network configuration: The client library might be using a proxy or network setting that causes issues on the server.
TLS or library-specific networking issues.
Different default timeouts or retry mechanisms in datadog-api-client vs. Axios.
Node.js version mismatch: The deployed environment may have a different version of Node.js affecting the behavior.
Workaround (Works with Axios)
const axios = require('axios');
axios.get('https://api.datadoghq.com/api/v1/dashboard', {
headers: {
'DD-API-KEY': 'xxx',
'DD-APPLICATION-KEY': 'xxx'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
This works fine, but datadog-api-client still fails.
Request for Help
Are there any known issues with datadog-api-client in a deployed environment?
Is there a recommended way to debug or configure the client for better connectivity?
Any guidance would be greatly appreciated. Thanks! 🙏
The text was updated successfully, but these errors were encountered: