brettlangdon / node-dogapi

Datadog API Node.JS Client
https://brettlangdon.github.io/node-dogapi/
105 stars 45 forks source link

using metric.send_all from EU region to US causing timeout 80% time #65

Open prtiwa opened 5 years ago

prtiwa commented 5 years ago

Using this librarys metric.send_all methos and sending metrics from Europe region to Datadog US site: we get 20% success rate , 80% failures caused with timeout errors? How can we increase timeout or add Header Connection: Keep-alive in our requests

2019-10-08T11:25:24.857Z 8d847170-26e0-42e2-a336-c7bd86fd1840 ERROR 1570533907242 'Failed send_all: Error: Client network socket disconnected before secure TLS connection was established Error: Client network socket disconnected before secure TLS connection was established\n at TLSSocket.onConnectEnd (_tls_wrap.js:1095:19)\n at Object.onceWrapper (events.js:286:20)\n at TLSSocket.emit (events.js:203:15)\n at TLSSocket.EventEmitter.emit (domain.js:448:20)\n at endReadableNT (_stream_readable.js:1145:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)'

prtiwa commented 5 years ago

Basically if client wants to give custom headers, it should be allowed and added here https://github.com/brettlangdon/node-dogapi/blob/master/lib/client.js#L81