Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
serviceName: process.env.TELEMETRY_TRACE_SERVICE || 'front',
host: agentHost,
port: agentPort,
tags: [{key: 'opencensus-exporter-jaeger', value: '0.0.22'}],
bufferTimeout: 10000, // time in milliseconds
logger,
};
jaegerExporter = new JaegerTraceExporter(jaegerOptions);
if (process.env.JAEGER_COLLECTOR_ENDPOINT) {
// This is a hack for when using JAEGER_COLLECTOR_ENDPOINT, because
// otherwise it uses UDPSender. This will be updated as soon as the
// opencensus library upgrades jaeger-client
const HTTPSender = require('jaeger-client/dist/src/reporters/http_sender')
.default;
jaegerExporter.sender = new HTTPSender({
...jaegerOptions,
endpoint: process.env.JAEGER_COLLECTOR_ENDPOINT,
});
jaegerExporter.sender.setProcess(jaegerExporter.process);
}
}
tracing.start({
samplingRate: 1,
plugins: {
http: '@opencensus/instrumentation-http',
},
stats: globalStats,
exporter: jaegerExporter,
propagation: jaegerExporter ? new B3Format() : null,
});