Home Reference Source Repository
import Singleton from 'opentracing/src/singleton.js'
public class | source

Singleton

Extends:

Tracer → Singleton

The Singleton object is the default export of the package and extends the standard Tracer object so that the default exported object of the package can be conveniently be used both as the default tracer and an interface to the library.

Method Summary

Public Methods
public

initGlobalTracer(tracerImp: TracerImp)

Set the global Tracer's underlying implementation.

The behavior is undefined if this function is called more than once.

public

initNewTracer(tracerImp: *): Tracer

Create a new Tracer object with the given underlying implementation.

Inherited Summary

From class Tracer
public

flush(done: function(err: objectg))

Request that any buffered or in-memory data is flushed out of the process.

public

imp(): object

Handle to implementation object.

public

inject(span: Span, format: string, carrier: any)

Injects the information about the given span into the carrier so that the span can propogate across inter-process barriers.

public

join(operationName: string, format: string, carrier: any): Span

Returns a new Span object with the given operation name using the trace information from the carrier.

public

startSpan(nameOrFields: string | object, fields: object): Span

Starts and returns a new Span representing a logical unit of work.

Public Methods

public initGlobalTracer(tracerImp: TracerImp) source

Set the global Tracer's underlying implementation.

The behavior is undefined if this function is called more than once.

Params:

NameTypeAttributeDescription
tracerImp TracerImp

the Tracer implementation object

public initNewTracer(tracerImp: *): Tracer source

Create a new Tracer object with the given underlying implementation.

Params:

NameTypeAttributeDescription
tracerImp *

Return:

Tracer

a new Tracer object