Documentation
¶
Overview ¶
Package telemetry holds the small amount of tracing plumbing warden's packages share: the instrumentation scope, span start, and error marking that never copies an error message onto a span.
Index ¶
Constants ¶
const InstrumentationName = "github.com/xraph/warden"
InstrumentationName is the instrumentation scope every warden span carries: the module path.
Variables ¶
This section is empty.
Functions ¶
func ErrorType ¶
ErrorType names err's class for a span: a known sentinel's name, else the Go type of the innermost error in its Unwrap chain.
func MarkError ¶
MarkError sets the span's status to Error and adds an exception event. Both carry only the error's type (ErrorType), never its message: store and driver messages quote values, and those can be personal data.
func StartChildSpan ¶
StartChildSpan is StartSpan for a step inside an operation that already has a span. When ctx's span isn't recording (an unsampled request, or no SDK installed), it starts nothing and returns ctx with a no-op span, so an unsampled operation doesn't pay for children nobody will export.
func StartSpan ¶
func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
StartSpan starts a span on the global tracer provider under warden's scope. The tracer is looked up on every call, the way forge and grove do it, so a provider installed after warden was loaded is the one used.
Types ¶
This section is empty.