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
Name | Type |
---|---|
args? | EndSpanArgs |
Returns
number
Implementation of
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
Name | Type |
---|---|
args? | EndSpanArgs |
Returns
number
The end time logged to the span metrics.
Implementation of
log
▸ log(_
): void
Incrementally update the current span with new data. The event will be batched and uploaded behind the scenes.
Parameters
Name | Type |
---|---|
_ | ExperimentLogPartialArgs |
Returns
void
Implementation of
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
Name | Type | Description |
---|---|---|
_0 | string | The name of the span. |
_1? | StartSpanArgs | - |
Returns
The newly-created Span
Implementation of
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
Name | Type |
---|---|
_0 | string |
callback | (span : Span ) => R |
_1 | StartSpanArgs & SetCurrentArg |
Returns
R
Implementation of
Properties
id
• id: string
Row ID of the span.
Implementation of
kind
• kind: "span"
Implementation of
root_span_id
• root_span_id: string
Span ID of the root span in the full trace.
Implementation of
span_id
• span_id: string
Span ID of the span. This is used to link spans together.