startup_tracing

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSpanFromContext added in v2.2.19

func CurrentSpanFromContext(ctx context.Context) trace.Span

CurrentSpanFromContext returns the current span, or nil if there is no active span.

func NewPropagatingRoundTripper

func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper

func TagsFromContext added in v2.2.136

func TagsFromContext(ctx context.Context) []attribute.KeyValue

TagsFromContext extracts tags stored in the context as OTel attributes.

func Trace added in v2.2.99

func Trace(ctx context.Context, op string, fn func(ctx context.Context, span trace.Span) error) (err error)

func TraceWithResult added in v2.2.113

func TraceWithResult[T any](ctx context.Context, op string, fn func(ctx context.Context, span trace.Span) (T, error)) (result T, err error)

TraceWithResult traces a child call while propagating the span using the context.

func Tracing

func Tracing(service string, op string) startup_http.HttpMiddleware

Tracing returns a middleware that adds tracing to an http handler.

func WithServiceOverride added in v2.2.136

func WithServiceOverride(ctx context.Context, service string) context.Context

WithServiceOverride adds service override tags to the context. See WithTags

func WithSpanPropagation

func WithSpanPropagation(client *http.Client) *http.Client

WithSpanPropagation returns a new http.Client that has automatic propagation of trace context enabled.

func WithTags added in v2.2.136

func WithTags(ctx context.Context, tags map[string]string) context.Context

WithTags adds the given tags to the context. All spans that are created using functions from this package will automatically set those tags.

Types

type TracingOptions

type TracingOptions struct {
	HttpEndpoint string `` /* 148-byte string literal not displayed */

	Inputs struct {
		// The service name of your application
		ServiceName string `validate:"required"`
	}
	// contains filtered or unexported fields
}

func (*TracingOptions) Initialize

func (opts *TracingOptions) Initialize()

func (*TracingOptions) IsActive

func (opts *TracingOptions) IsActive() bool

Jump to

Keyboard shortcuts

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