rpc

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRACE_ID = iota
	SPAN_ID
	PARENT_SPAN_ID
	SERVICE_NAME
	METHOD_NAME
	PROTOCOL
	RESULT_STATUS
	REQUEST_SIZE
	RESPONSE_SIZE
	UPSTREAM_HOST_ADDRESS
	DOWNSTEAM_HOST_ADDRESS
	APP_NAME        //caller
	TARGET_APP_NAME //remote app
	SPAN_TYPE
	BAGGAGE_DATA
	REQUEST_URL
	TARGET_CELL
	TARGET_IDC
	TARGET_CITY
	ROUTE_RECORD
	CALLER_CELL

	TRACE_END = 60
)

Variables

View Source
var PrintLog = true

Functions

func NewTracer

func NewTracer(config map[string]interface{}) (types.Tracer, error)

func RegisterSubProtocol

func RegisterSubProtocol(protocolCode byte, delegate SubProtocolDelegate)

Types

type SofaRPCSpan

type SofaRPCSpan struct {
	// contains filtered or unexported fields
}

func NewSpan

func NewSpan(startTime time.Time) *SofaRPCSpan

func (*SofaRPCSpan) EndTime

func (s *SofaRPCSpan) EndTime() time.Time

func (*SofaRPCSpan) FinishSpan

func (s *SofaRPCSpan) FinishSpan()

func (*SofaRPCSpan) InjectContext

func (s *SofaRPCSpan) InjectContext(requestHeaders types.HeaderMap)

func (*SofaRPCSpan) ParentSpanId

func (s *SofaRPCSpan) ParentSpanId() string

func (*SofaRPCSpan) SetOperation

func (s *SofaRPCSpan) SetOperation(operation string)

func (*SofaRPCSpan) SetRequestInfo

func (s *SofaRPCSpan) SetRequestInfo(reqinfo types.RequestInfo)

func (*SofaRPCSpan) SetStartTime

func (s *SofaRPCSpan) SetStartTime(startTime time.Time)

func (*SofaRPCSpan) SetTag

func (s *SofaRPCSpan) SetTag(key uint64, value string)

func (*SofaRPCSpan) SpanId

func (s *SofaRPCSpan) SpanId() string

func (*SofaRPCSpan) SpawnChild

func (s *SofaRPCSpan) SpawnChild(operationName string, startTime time.Time) types.Span

func (*SofaRPCSpan) StartTime

func (s *SofaRPCSpan) StartTime() time.Time

func (*SofaRPCSpan) String

func (s *SofaRPCSpan) String() string

func (*SofaRPCSpan) Tag

func (s *SofaRPCSpan) Tag(key uint64) string

func (*SofaRPCSpan) TraceId

func (s *SofaRPCSpan) TraceId() string

type SubProtocolDelegate

type SubProtocolDelegate func(ctx context.Context, request sofarpc.SofaRpcCmd, span types.Span)

type Tracer

type Tracer struct{}

func (*Tracer) Start

func (tracer *Tracer) Start(ctx context.Context, request interface{}, startTime time.Time) types.Span

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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