tracer

package
v0.0.0-...-0f17f66 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_TYPE_SIMPLE = iota
	CONFIG_TYPE_ETCD
)
View Source
const (
	ENV_JAEGER_AGENT_HOST = "JAEGER_AGENT_HOST"
	ENV_JAEGER_AGENT_PORT = "JAEGER_AGENT_PORT"
)
View Source
const (
	JAEGER_DEBUG_HEADER         = "trace-debug-id"
	JAEGER_BAGGAGE_HEADER       = "trace-baggage"
	TRACE_CONTEXT_HEADER_NAME   = "banyu-trace-id"
	TRACE_BAGGAGE_HEADER_PREFIX = "dyctx-"
)
View Source
const (
	ContextKeyTraceID = "traceID"
	ContextKeyControl = "Control"

	ContextKeyHead        = "Head"
	ContextKeyHeadUid     = "uid"
	ContextKeyHeadSource  = "source"
	ContextKeyHeadIp      = "ip"
	ContextKeyHeadRegion  = "region"
	ContextKeyHeadDt      = "dt"
	ContextKeyHeadUnionId = "unionid"
)

由于请求的上下文信息的 thrift 定义在 util 项目中,本模块主要为了避免循环依赖

View Source
const (
	TRACER_TYPE_JAEGER = "jaeger"
)

Variables

This section is empty.

Functions

func CloseTracer

func CloseTracer() error

func GetDt

func GetDt(ctx context.Context) (dt int32, ok bool)

func GetGroup

func GetGroup(ctx context.Context) string

func GetGroupWithDefault

func GetGroupWithDefault(ctx context.Context, dv string) string

func GetIp

func GetIp(ctx context.Context) (ip string, ok bool)

func GetRegion

func GetRegion(ctx context.Context) (region string, ok bool)

func GetSource

func GetSource(ctx context.Context) (source int32, ok bool)

func GetUid

func GetUid(ctx context.Context) (uid int64, ok bool)

func GetUnionId

func GetUnionId(ctx context.Context) (unionId string, ok bool)

func InitDefaultTracer

func InitDefaultTracer(serviceName string) error

func InitTracer

func InitTracer(tracerType string, serviceName string) error

Types

type Config

type Config struct {
	TracerType   string
	ServiceName  string
	TracerConfig interface{}
}

type Configurator

type Configurator interface {
	GetConfig(serviceName string) *Config
}

func NewConfigurator

func NewConfigurator(configType int) (Configurator, error)

func NewEtcdConfigurator

func NewEtcdConfigurator() Configurator

func NewSimpleConfigurator

func NewSimpleConfigurator() Configurator

type ContextController

type ContextController interface {
	GetGroup() string
}

type ContextHeader

type ContextHeader interface {
	ToKV() map[string]interface{}
}

type EtcdConfig

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

func (*EtcdConfig) GetConfig

func (m *EtcdConfig) GetConfig(serviceName string) *Config
type Head struct {
	Ip         string `json:"ip"`
	DeviceId   string `json:"did"`
	Region     string `json:"region"`
	DeviceType int32  `json:"dt"`
	Source     int32  `json:"source"`
	Uid        int64  `json:"uid"`
	Token      string `json:"token"`
}

type SimpleConfig

type SimpleConfig struct {
}

func (*SimpleConfig) GetConfig

func (m *SimpleConfig) GetConfig(serviceName string) *Config

Jump to

Keyboard shortcuts

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