Skip to content

Commit

Permalink
添加明细的应用信息
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Dec 31, 2023
1 parent 8323b70 commit abb4016
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions trace/baseTraceDetail.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ var ScopeLevel = asyncLocal.New[[]BaseTraceDetail]()

// BaseTraceDetail 埋点明细(基类)
type BaseTraceDetail struct {
TraceId int64 // 上下文ID
AppId int64 // 应用ID
AppName string // 应用名称
AppIp string // 应用IP
ParentAppName string // 上游应用
DetailId int64 // 明细ID
ParentDetailId int64 // 父级明细ID
Level int // 当前层级(入口为0层)
Expand Down
3 changes: 3 additions & 0 deletions trace/emptyManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func (*emptyTraceContext) AddDetail(detail ITraceDetail)
func (*emptyTraceContext) GetList() []any {
return []any{}
}
func (*emptyTraceContext) GetAppInfo() (int64, string, int64, string, string) {
return 0, "", 0, "", ""
}

type emptyTraceDetail struct{}

Expand Down
2 changes: 2 additions & 0 deletions trace/iTraceContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ type ITraceContext interface {
Error(err error)
// Ignore 忽略这次的链路追踪
Ignore()
// GetAppInfo 获取应用信息
GetAppInfo() (int64, string, int64, string, string)
}

0 comments on commit abb4016

Please sign in to comment.