Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main () {
// Setup Tracer
const tracer = tracing.start({
samplingRate: 1,
propagation: new propagation.TraceContextFormat()
}).tracer;
// Setup Exporter, Enable GRPC and HTTP plugin
enableJaegerTraceExporter(tracer);
enableHttpPlugin(tracer);
//enableGrpcPlugin(tracer);
// Start GRPC Server
grpcServer.start(interop.ServicePort.NODEJS_GRPC_BINARY_PROPAGATION_PORT, '0.0.0.0');
// Start HTTP Server
httpServer.start(interop.ServicePort.NODEJS_HTTP_TRACECONTEXT_PROPAGATION_PORT, '0.0.0.0');
}function setupTracerAndExporters () {
const zipkinOptions = {
url: 'http://localhost:9411/api/v2/spans',
serviceName: 'opencensus_tutorial'
};
// Creates Zipkin exporter
const exporter = new ZipkinTraceExporter(zipkinOptions);
// Starts tracing and set sampling rate, exporter and propagation
const tracer = tracing.start({
exporter,
samplingRate: 1, // For demo purposes, always sample
propagation: new TraceContextFormat(),
logLevel: 1 // show errors, if any
}).tracer;
return tracer;
}function setupTracerAndExporters () {
const zipkinOptions = {
url: 'http://localhost:9411/api/v2/spans',
serviceName: 'opencensus_tutorial'
};
// Creates Zipkin exporter
const exporter = new ZipkinTraceExporter(zipkinOptions);
// Starts tracing and set sampling rate, exporter and propagation
const tracer = tracing.start({
exporter,
samplingRate: 1, // For demo purposes, always sample
propagation: new TraceContextFormat(),
logLevel: 1 // show errors, if any
}).tracer;
return tracer;
}function setupTracerAndExporters() {
const zipkinOptions = {
url: 'http://localhost:9411/api/v2/spans',
serviceName: 'opencensus_web_server'
};
// Creates Zipkin exporter
const exporter = new ZipkinTraceExporter(zipkinOptions);
// Starts tracing and set sampling rate, exporter and propagation
const tracer = tracing.start({
exporter,
samplingRate: 1, // For demo purposes, always sample
propagation: new TraceContextFormat(),
logLevel: 1 // show errors, if any
}).tracer;
return tracer;
}const getNewPropagation = async () => Promise.resolve(new TraceContextFormat());