Docs
SDK reference
classes
Noopspan

Class: NoopSpan

A fake implementation of the Span API which does nothing. This can be used as the default span.

Implements

Constructors

constructor

new NoopSpan()

Methods

close

close(args?): number

Alias for end.

Parameters

NameType
args?EndSpanArgs

Returns

number

Implementation of

Span.close


end

end(args?): number

Terminate the span. Returns the end time logged to the row's metrics. After calling end, you may not invoke any further methods on the span object, except for the property accessors.

Will be invoked automatically if the span is constructed with traced.

Parameters

NameType
args?EndSpanArgs

Returns

number

The end time logged to the span metrics.

Implementation of

Span.end


log

log(_): void

Incrementally update the current span with new data. The event will be batched and uploaded behind the scenes.

Parameters

NameType
_ExperimentLogPartialArgs

Returns

void

Implementation of

Span.log


startSpan

startSpan(_0, _1?): NoopSpan

Create a new span. This is useful if you want to log more detailed trace information beyond the scope of a single log event. Data logged over several calls to Span.log will be merged into one logical row.

We recommend running spans within a callback (using traced) to automatically mark them as current and ensure they are terminated. If you wish to start a span outside a callback, be sure to terminate it with span.end().

Parameters

NameTypeDescription
_0stringThe name of the span.
_1?StartSpanArgs-

Returns

NoopSpan

The newly-created Span

Implementation of

Span.startSpan


traced

traced<R>(_0, callback, _1): R

Wrapper over Span.startSpan, which passes the initialized Span it to the given callback and ends it afterwards. See Span.startSpan for full details.

Type parameters

Name
R

Parameters

NameType
_0string
callback(span: Span) => R
_1StartSpanArgs & SetCurrentArg

Returns

R

Implementation of

Span.traced

Properties

id

id: string

Row ID of the span.

Implementation of

Span.id


kind

kind: "span"

Implementation of

Span.kind


root_span_id

root_span_id: string

Span ID of the root span in the full trace.

Implementation of

Span.root_span_id


span_id

span_id: string

Span ID of the span. This is used to link spans together.

Implementation of

Span.span_id