sofa

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// old key
	TARGET_SERVICE_KEY = "sofa_head_target_service"
	// new key
	SERVICE_KEY             = "service"
	TARGET_METHOD_KEY       = "sofa_head_method_name"
	RPC_ID_KEY              = "rpc_trace_context.sofaRpcId"
	TRACER_ID_KEY           = "rpc_trace_context.sofaTraceId"
	CALLER_IP_KEY           = "rpc_trace_context.sofaCallerIp"
	CALLER_ZONE_KEY         = "rpc_trace_context.sofaCallerZone"
	APP_NAME_KEY            = "rpc_trace_context.sofaCallerApp"
	SOFA_TRACE_BAGGAGE_DATA = "rpc_trace_context.sofaPenAttrs"
	// http key
	HTTP_RPC_ID_KEY    = "SOFA-RpcId"
	HTTP_TRACER_ID_KEY = "SOFA-TraceId"
)

Const of tracing key

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
	CALLER_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 = 70
)
View Source
const (
	MOSN_PROCESS_TIME = 60 + iota
	MOSN_TLS_STATE
	TLSCipherSuite
	MOSN_PROCESS_FAIL
)

Variables

View Source
var PrintLog = true

Functions

func NewTracer added in v0.26.0

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

Types

type SofaRPCSpan added in v0.26.0

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

func NewSpan added in v0.26.0

func NewSpan(ctx context.Context, startTime time.Time) *SofaRPCSpan

func (*SofaRPCSpan) EndTime added in v0.26.0

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

func (*SofaRPCSpan) FinishSpan added in v0.26.0

func (s *SofaRPCSpan) FinishSpan()

func (*SofaRPCSpan) InjectContext added in v0.26.0

func (s *SofaRPCSpan) InjectContext(requestHeaders api.HeaderMap, requestInfo api.RequestInfo)

func (*SofaRPCSpan) ParentSpanId added in v0.26.0

func (s *SofaRPCSpan) ParentSpanId() string

func (*SofaRPCSpan) SetOperation added in v0.26.0

func (s *SofaRPCSpan) SetOperation(operation string)

func (*SofaRPCSpan) SetRequestInfo added in v0.26.0

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

func (*SofaRPCSpan) SetStartTime added in v0.26.0

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

func (*SofaRPCSpan) SetTag added in v0.26.0

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

func (*SofaRPCSpan) SpanId added in v0.26.0

func (s *SofaRPCSpan) SpanId() string

func (*SofaRPCSpan) SpawnChild added in v0.26.0

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

func (*SofaRPCSpan) StartTime added in v0.26.0

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

func (*SofaRPCSpan) String added in v0.26.0

func (s *SofaRPCSpan) String() string

func (*SofaRPCSpan) Tag added in v0.26.0

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

func (*SofaRPCSpan) TraceId added in v0.26.0

func (s *SofaRPCSpan) TraceId() string

type Tracer added in v0.26.0

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

Tracer is default trace action

func (*Tracer) InitLogger added in v0.26.0

func (tracer *Tracer) InitLogger(root, ingress, egress string) (e error)

func (*Tracer) NewSpan added in v0.26.0

func (tracer *Tracer) NewSpan(ctx context.Context, startTime time.Time) *SofaRPCSpan

func (*Tracer) Start added in v0.26.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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