trace

package
v0.0.0-...-9fcd7d3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallTime

type CallTime struct {
	StartTime  uint64 `json:"startTime"`
	TotalTime  uint64 `json:"totalTime"`
	P90        uint64 `json:"p90"`
	IsProfiled bool   `json:"isProfiled"`
	IsMutated  bool   `json:"isMutated"`
	SpanId     string `json:"spanId"`
}

type Edge

type Edge struct {
	Source string `json:"source"`
	Target string `json:"target"`
}

type EntryData

type EntryData struct {
	ContentKey string `json:"contentKey"`
	StartTime  uint64 `json:"startTime"`
	TotalTime  uint64 `json:"totalTime"`
	P90        uint64 `json:"p90"`
}

type Node

type Node struct {
	Id       string      `json:"id"`
	CallList []*CallTime `json:"list"`
}

type OTelClientCall

type OTelClientCall struct {
	// 上游对外调用Span
	ClientSpan *ptrace.Span
	// 下游接收入口Span
	ServerEntrySpan *ptrace.Span
	// contains filtered or unexported fields
}

func NewOTelClientCall

func NewOTelClientCall(clientSpan *ptrace.Span, serverEntrySpan *ptrace.Span, serverBusinessSpan *ptrace.Span) *OTelClientCall

func (*OTelClientCall) GetSpanId

func (clientCall *OTelClientCall) GetSpanId() string

type OTelSpanTreeNode

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

type OTelTrace

type OTelTrace struct {
	Traces ptrace.Traces
	// contains filtered or unexported fields
}

func NewOTelTrace

func NewOTelTrace() *OTelTrace

func (*OTelTrace) BuildApmTraceTree

func (trace *OTelTrace) BuildApmTraceTree(sampledNodeMap map[string]*TraceTreeNode, mutatedSpanId string) *TraceTree

func (*OTelTrace) BuildSampledTraceTree

func (trace *OTelTrace) BuildSampledTraceTree(sampledTraces *model.Traces) (*TraceTree, error)

BuildTopologyTree 构建拓扑树

func (*OTelTrace) BuildSpanTree

func (trace *OTelTrace) BuildSpanTree()

func (*OTelTrace) GetChildTraces

func (trace *OTelTrace) GetChildTraces(spanId string, traces []*model.Trace) []*model.Trace

获取对外调用,存在后端应用未监控场景

func (*OTelTrace) GetClientCalls

func (trace *OTelTrace) GetClientCalls(spanId string, spanIds []string) []*OTelClientCall

获取对外调用,存在后端应用未监控场景

func (*OTelTrace) GetMutatedTrace

func (trace *OTelTrace) GetMutatedTrace(sampledTraces *model.Traces) (*model.Trace, error)

func (*OTelTrace) GetTraceRelationship

func (trace *OTelTrace) GetTraceRelationship(mutatedSpanId string, sampledTraces *model.Traces) *TraceData

GetTraceRelationship 生成Trace调用关系图,以服务名进行收敛

func (*OTelTrace) IsRootTrace

func (trace *OTelTrace) IsRootTrace(spanId string) bool

type TraceData

type TraceData struct {
	Entry *EntryData `json:"entry"`
	Nodes []*Node    `json:"nodes"`
	Edges []*Edge    `json:"edges"`
}

type TraceTree

type TraceTree struct {
	Root    *TraceTreeNode
	NodeMap map[string]*TraceTreeNode
	// contains filtered or unexported fields
}

func (*TraceTree) GetMutatedTraceNode

func (tree *TraceTree) GetMutatedTraceNode(traceId string, ratioThreshold int) (*TraceTreeNode, error)

type TraceTreeNode

type TraceTreeNode struct {
	Id           string           `json:"id"`
	Url          string           `json:"url"`
	StartTime    uint64           `json:"startTime"`
	TotalTime    uint64           `json:"totalTime"`
	P90          uint64           `json:"p90"`
	IsTraced     bool             `json:"isTraced"`
	IsProfiled   bool             `json:"isProfiled"`
	IsPath       bool             `json:"isPath"`
	IsMutated    bool             `json:"isMutated"`
	SelfTime     uint64           `json:"selfTime"`
	SelfP90      uint64           `json:"selfP90"`
	MutatedValue int64            `json:"mutatedValue"`
	SpanId       string           `json:"spanId"`
	Children     []*TraceTreeNode `json:"children"`
}

Jump to

Keyboard shortcuts

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