tracing

package
v0.0.0-...-43b7830 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepDispatcher          = "dispatcher"
	StepTransport           = "transport"
	StepGotConn             = "got_conn"
	StepWroteRequestHeader  = "wrote_req_header"
	StepReadRequest         = "read_request"
	StepWroteRequest        = "wrote_req"
	StepFirstResponse       = "first_resp_byte"
	StepGotResponse         = "got_resp"
	StepWroteResponseHeader = "wrote_resp_header"
	StepReadResp            = "read_resp"
	StepWroteResp           = "wrote_resp"
)
View Source
const (
	MetricStageClientRead    = "client_read"
	MetricStageClientWrite   = "client_write"
	MetricStageUpstreamRead  = "upstream_read"
	MetricStageUpstreamWrite = "upstream_write"
	MetricStageHandlingDelay = "handling_delay"
)

Variables

This section is empty.

Functions

func Step

func Step(ctx context.Context, msg string, options ...StepOption)

func TraceID

func TraceID(ctx context.Context) int32

func WithRequestTraceInfo

func WithRequestTraceInfo(parent context.Context, info *RequestTraceInfo) context.Context

WithRequestTraceInfo returns a copy of parent in which the RequestTraceInfo value is set

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

func StringKeyValue

func StringKeyValue(key, val string) KeyValue

type RequestTraceInfo

type RequestTraceInfo struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(name string) *RequestTraceInfo

func RequestTraceInfoFrom

func RequestTraceInfoFrom(ctx context.Context) (*RequestTraceInfo, bool)

RequestTraceInfoFrom returns the value of the RequestTraceInfo key on the ctx

func (*RequestTraceInfo) End

func (t *RequestTraceInfo) End()

func (*RequestTraceInfo) ID

func (t *RequestTraceInfo) ID() int32

func (*RequestTraceInfo) IfLong

func (t *RequestTraceInfo) IfLong(threshold time.Duration) bool

func (*RequestTraceInfo) Log

func (t *RequestTraceInfo) Log()

func (*RequestTraceInfo) StageLatency

func (t *RequestTraceInfo) StageLatency() map[string]time.Duration

func (*RequestTraceInfo) Step

func (t *RequestTraceInfo) Step(msg string, options ...StepOption)

func (*RequestTraceInfo) WithAttributes

func (t *RequestTraceInfo) WithAttributes(attributes ...KeyValue)

func (*RequestTraceInfo) WithHttpTrace

func (t *RequestTraceInfo) WithHttpTrace()

type StepOption

type StepOption interface {
	// contains filtered or unexported methods
}

func WithStepTimestamp

func WithStepTimestamp(t time.Time) StepOption

type Transition

type Transition struct {
	From    string
	FromAlt string // alternative
	To      string
}

Transition describe transition between two phases.

Jump to

Keyboard shortcuts

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