fix(collector): optimized metrics timeout handling#2084
Conversation
| ); | ||
|
|
||
| req.setTimeout(agentOpts.requestTimeout, function onTimeout() { | ||
| if (req.destroyed) { |
There was a problem hiding this comment.
This resolves the warning
{"level":20,"time":"2025-10-13T15:58:45.423Z","threadId":0,"name":"@instana/collector","msg":"Function callback for sendData: /com.instana.plugin.nodejs.41842 was called 2 times. This time with the following arguments: {"args":[{}]}"}
| ' This will not affect monitoring or tracing.' | ||
| ); | ||
| if (typeof error.message === 'string' && error.message.indexOf('Got status code 404')) { | ||
| if (typeof error.message === 'string' && error.message.indexOf('Got status code 404') !== -1) { |
There was a problem hiding this comment.
The good old classic bug.
error.message.indexOf('Got status code 404')
Thats why
Apparently the version of the Instana host agent on this host does not support the POST /tracermetrics endpoint, will stop sending tracing metrics.
Appeared in the logs. But that was wrong. We do not receive a 404 on timeout error.
| } else if (originalTracingMetricsDelay !== null) { | ||
| // on success, restore original delay | ||
| tracingMetricsDelay = originalTracingMetricsDelay; | ||
| originalTracingMetricsDelay = null; |
There was a problem hiding this comment.
Added a tiny logic to increase the retry time for sending tracer metrics to /tracermetrics endpoint on error. Please review carefully.
There was a problem hiding this comment.
SInce this is metrics only, I think this should be fine
|



refs https://jsw.ibm.com/browse/INSTA-59265