telemetry

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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

View Source
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

func ErrorType(err error) string

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

func MarkError(span trace.Span, err error)

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

func StartChildSpan(ctx context.Context, name string) (context.Context, trace.Span)

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.

Jump to

Keyboard shortcuts

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