Documentation ¶
Index ¶
- Constants
- func Step(ctx context.Context, msg string, options ...StepOption)
- func TraceID(ctx context.Context) int32
- func WithRequestTraceInfo(parent context.Context, info *RequestTraceInfo) context.Context
- type KeyValue
- type RequestTraceInfo
- func (t *RequestTraceInfo) End()
- func (t *RequestTraceInfo) ID() int32
- func (t *RequestTraceInfo) IfLong(threshold time.Duration) bool
- func (t *RequestTraceInfo) Log()
- func (t *RequestTraceInfo) StageLatency() map[string]time.Duration
- func (t *RequestTraceInfo) Step(msg string, options ...StepOption)
- func (t *RequestTraceInfo) WithAttributes(attributes ...KeyValue)
- func (t *RequestTraceInfo) WithHttpTrace()
- type StepOption
- type Transition
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 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 ¶
func StringKeyValue ¶
type RequestTraceInfo ¶
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) 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 ¶
Transition describe transition between two phases.
Click to show internal directories.
Click to hide internal directories.