Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setupTracerAndExporters(service) {
const tracer = new NodeTracer();
let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
exporter = new ZipkinExporter({
serviceName: service,
});
} else {
exporter = new JaegerExporter({
serviceName: service,
});
}
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));
// Initialize the OpenTelemetry APIs to use the BasicTracer bindings
opentelemetry.initGlobalTracer(tracer);
function setupTracerAndExporters(service) {
const tracer = new NodeTracer({
plugins: {
grpc: {
enabled: true,
// if it can't find the module, put the absolute path since the packages are not published yet
path: '@opentelemetry/plugin-grpc'
}
}
});
let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
exporter = new ZipkinExporter({
serviceName: service,
});
} else {
exporter = new JaegerExporter({
function setupTracerAndExporters(service) {
const tracer = new NodeTracer({
plugins: {
dns: {
enabled: true,
path: '@opentelemetry/plugin-dns',
// Avoid dns lookup loop with http zipkin calls
ignoreHostnames: ['localhost']
}
}
});
let exporter;
if (EXPORTER.toLowerCase().startsWith('z')) {
exporter = new ZipkinExporter({
serviceName: service,
});
} else {
function setupTracerAndExporters(service) {
let exporter;
const tracer = new NodeTracer();
if (EXPORTER.toLowerCase().startsWith('z')) {
exporter = new ZipkinExporter({
serviceName: service
});
} else {
exporter = new JaegerExporter({
serviceName: service,
});
}
tracer.addSpanProcessor(new SimpleSpanProcessor(exporter));
// Initialize the OpenTelemetry APIs to use the BasicTracer bindings
opentelemetry.initGlobalTracer(tracer);
}
function setupTracerAndExporters(service) {
const tracer = new NodeTracer({
plugins: {
mysql: {
enabled: true,
path: "@opentelemetry/plugin-mysql"
},
http: {
enabled: true,
path: "@opentelemetry/plugin-http"
}
}
});
tracer.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
serviceName: service,
})));
tracer.addSpanProcessor(new SimpleSpanProcessor(new JaegerExporter({