Documentation
¶
Overview ¶
Package opspan opens the span of one operation of a store or a client, such as job.list or audit.get. The calls that the operation makes, such as the NATS calls, are its children. Thus a trace tells what the time of a request was for, where it would show only NATS calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func End ¶
End ends span, with the error status when err is not nil, and returns err, so a call can end with return opspan.End(span, err).
func Root ¶
func Root( ctx context.Context, tracer string, name string, attrs ...attribute.KeyValue, ) (context.Context, trace.Span)
Root starts a span whether or not ctx has one: the span of work that no request or job started, such as a join over NATS or a timer's pass.
func Start ¶
func Start( ctx context.Context, tracer string, name string, attrs ...attribute.KeyValue, ) (context.Context, trace.Span)
Start opens the span name, from the tracer of the package that tracer names, with attrs. Outside a trace, such as a metrics refresh or a health probe, it opens none and returns ctx with its no-op span, as nats-client does for a call: each refresh would otherwise start a trace of its own.
Types ¶
This section is empty.