telemetry

package
v1.124.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpSpan

type HttpSpan struct {
	StarterFunc           func(s *HttpSpan)
	FinisherFunc          func(s *HttpSpan, httpCode int, whoFinishes string)
	Id, Php, Path, Method string
	T0, T1                time.Time // the time bounds of the span
	ExtraObject           any       // can be used to attach extra user context, e.g. to report data transferred, other attributes of a span
}

func (*HttpSpan) Finish

func (s *HttpSpan) Finish(httpCode int, whoFinishes string)

only calls a finisher, if T0 was set, else ignores it

func (*HttpSpan) Start added in v1.12.2

func (s *HttpSpan) Start()

type HttpSpanCreator

type HttpSpanCreator struct {
	StarterFunc  func(s *HttpSpan)
	FinisherFunc func(s *HttpSpan, httpCode int, whoFinishes string)
}

func NewHttpSpanCreator

func NewHttpSpanCreator(optFuncs ...func(c *HttpSpanCreator)) (c *HttpSpanCreator, err error)

deprecated, please use the generic span instead

func (*HttpSpanCreator) NewSpan

func (c *HttpSpanCreator) NewSpan(id, php, path, method string) (s *HttpSpan)

deprecated, please use the generic span instead

type Span added in v1.30.0

type Span[T any] struct {
	T0, T1    time.Time // the time bounds of the span
	UserAttrs T
	// contains filtered or unexported fields
}

func (*Span[T]) Finish added in v1.30.0

func (s *Span[T]) Finish(of ...func(s *Span[T]))

only calls a finisher, if T0 was set, else ignores it

func (*Span[T]) Start added in v1.30.0

func (s *Span[T]) Start()

type SpanCreator added in v1.30.0

type SpanCreator[T any] struct {
	StarterFunc  func(s *Span[T])
	FinisherFunc func(s *Span[T])
	ErrorFunc    func(s *Span[T], err error)
}

func NewSpanCreator added in v1.30.0

func NewSpanCreator[T any](optFuncs ...func(c *SpanCreator[T])) (c *SpanCreator[T])

func (*SpanCreator[T]) NewSpan added in v1.30.0

func (c *SpanCreator[T]) NewSpan(of ...func(s *Span[T])) (s *Span[T])

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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