opspan

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func End(
	span trace.Span,
	err error,
) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL