Proxy tracer provided by the proxy tracer provider

1.0.0

Implements

Constructors

Properties

name: string
version?: string

Methods

  • Starts a new Span and calls the given function passing it the created span as first argument. Additionally the new span gets set in context and this context is activated for the duration of the function call.

    Type Parameters

    Parameters

    Returns ReturnType<F>

    return value of fn

    const something = tracer.startActiveSpan('op', span => {
    try {
    do some work
    span.setStatus({code: SpanStatusCode.OK});
    return something;
    } catch (err) {
    span.setStatus({
    code: SpanStatusCode.ERROR,
    message: err.message,
    });
    throw err;
    } finally {
    span.end();
    }
    });
    const span = tracer.startActiveSpan('op', span => {
    try {
    do some work
    return span;
    } catch (err) {
    span.setStatus({
    code: SpanStatusCode.ERROR,
    message: err.message,
    });
    throw err;
    }
    });
    do some more work
    span.end();