trace

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const (
	X_YUNION_PEER_SERVICE_NAME = "X-Yunion-Peer-Service-Name"
	// X_YUNION_SERVICE_NAME   = "X-Yunion-Service-Name"
	X_YUNION_TRACE_ID    = "X-Yunion-STrace-Id"
	X_YUNION_SPAN_NAME   = "X-Yunion-Span-Name"
	X_YUNION_PARENT_ID   = "X-Yunion-Parent-Id"
	X_YUNION_SPAN_ID     = "X-Yunion-Span-Id"
	X_YUNION_TRACE_DEBUG = "X-Yunion-STrace-Debug"
	X_YUNION_REMOTE_ADDR = "X-Yunion-Remote-Addr"
	X_YUNION_TRACE_TAG   = "X-Yunion-STrace-Tag-"
)
View Source
const UNKNOWN_SERVICE_NAME string = "(unknown_service)"

Variables

This section is empty.

Functions

func SubmitTrace

func SubmitTrace(trace *STrace)

Types

type STrace

type STrace struct {
	TraceId  string
	Name     string
	ParentId string
	Id       string

	Kind           TraceKind
	Timestamp      time.Time
	Duration       time.Duration
	Debug          bool
	Shared         bool
	LocalEndpoint  STraceEndpoint
	RemoteEndpoint STraceEndpoint
	Tags           map[string]string
	// contains filtered or unexported fields
}

func StartClientTrace

func StartClientTrace(ctxTrace *STrace, remoteAddr string, remotePort int, localServiceName string) *STrace

func StartServerTrace

func StartServerTrace(w http.ResponseWriter, r *http.Request, localSpanName string, localServiceName string, srvTags map[string]string) *STrace

func (*STrace) AddClientRequestHeader

func (tr *STrace) AddClientRequestHeader(header http.Header)

func (*STrace) EndClientTrace

func (tr *STrace) EndClientTrace(spanName, remoteServiceName, localAddr string, tags map[string]string)

func (*STrace) EndClientTraceHeader

func (tr *STrace) EndClientTraceHeader(header http.Header)

func (*STrace) EndTrace

func (tr *STrace) EndTrace()

func (*STrace) IsZero

func (tr *STrace) IsZero() bool

func (*STrace) String

func (tr *STrace) String() string

type STraceEndpoint

type STraceEndpoint struct {
	ServiceName string
	Addr        string
	Port        int
}

type TraceKind

type TraceKind string
const (
	TRACE_KIND_CLIENT TraceKind = "CLIENT"
	TRACE_KIND_SERVER TraceKind = "SERVER"
)

Jump to

Keyboard shortcuts

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