Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function sendTracingMetrics() {
var payload = tracing._getAndResetTracingMetrics();
agentConnection.sendTracingMetricsToAgent(payload, function(error) {
if (error) {
logger.warn('Error received while trying to send tracing metrics to agent: %s', error.message);
if (typeof error.message === 'string' && error.message.indexOf('Got status code 404')) {
logger.warn('Apparently the agent does not support POST /tracermetrics, will stop sending tracing metrics.');
return;
}
}
scheduleTracingMetrics();
});
}