Error sending spans over HTTP: Error
vishnugupta20 opened this issue · 1 comments
Hello Everyone, Migrated in our project from signalfx-tracing
to splunk-otel
everything was working fine since yesterday. But suddenly started getting an error shown below
{"stack":"Error: error sending spans over HTTP: Error: connect ECONNREFUSED 127.0.0.1:14268\n at /home/app/node_modules/@opentelemetry/exporter-jaeger/build/src/jaeger.js:134:35\n at Function.invokeCallback (/home/app/node_modules/jaeger-client/dist/src/reporters/sender_utils.js:33:9)\n at ClientRequest.<anonymous> (/home/app/node_modules/jaeger-client/dist/src/reporters/http_sender.js:159:32)\n at /home/app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:49:55\n at AsyncLocalStorage.run (node:async_hooks:320:14)\n at AsyncLocalStorageContextManager.with (/home/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n at ClientRequest.contextWrapper (/home/app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:49:32)\n at ClientRequest.emit (node:events:402:35)\n at ClientRequest.emit (node:domain:475:12)\n at Socket.socketErrorListener (node:_http_client:447:9)\n at Socket.emit (node:events:390:28)\n at Socket.emit (node:domain:475:12)\n at emitErrorNT (node:internal/streams/destroy:157:8)\n at emitErrorCloseNT (node:internal/streams/destroy:122:3)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)","message":"error sending spans over HTTP: Error: connect ECONNREFUSED 127.0.0.1:14268","name":"Error"}
Code implemented as are follows
List of package installed in package.json
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/instrumentation-connect": "^0.29.0",
"@opentelemetry/instrumentation-dns": "^0.29.0",
"@opentelemetry/instrumentation-express": "^0.30.0",
"@opentelemetry/instrumentation-hapi": "^0.29.0",
"@opentelemetry/instrumentation-http": "^0.30.0",
"@opentelemetry/instrumentation-winston": "^0.29.0",
"@splunk/otel": "^1.1.0",
tracer.js class code
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
console.log('Enabling tracing via OpenTelemetry',process.env.OTEL_LOG_LEVEL);
// If OTEL_LOG_LEVEL env var is set, configure logger
if (process.env.OTEL_LOG_LEVEL) {
//diag.setLogger(new DiagConsoleLogger(), DiagLogLevel[process.env.OTEL_LOG_LEVEL ? process.env.OTEL_LOG_LEVEL : 'DEBUG']);
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ALL);
}
const tracer = require('@splunk/otel').startTracing();
module.exports = tracer;
Environment variable
export OTEL_TRACE_ENABLED=true
export OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:9080/v1/trace
export OTEL_TRACES_EXPORTER=jaeger-thrift-splunk
export OTEL_LOG_LEVEL=DEBUG
export OTEL_PROPAGATORS=b3multi
Please reopen if this still persists, however I think if you're getting ECONNREFUSED
it might be a configuration issue at collector. As of 2.0.0 we no longer support Jaeger exporter anyway, it's advised to move to OTLP (the default).