Documentation
¶
Index ¶
- Constants
- func CloseTracer() error
- func GetDt(ctx context.Context) (dt int32, ok bool)
- func GetGroup(ctx context.Context) string
- func GetGroupWithDefault(ctx context.Context, dv string) string
- func GetIp(ctx context.Context) (ip string, ok bool)
- func GetRegion(ctx context.Context) (region string, ok bool)
- func GetSource(ctx context.Context) (source int32, ok bool)
- func GetUid(ctx context.Context) (uid int64, ok bool)
- func GetUnionId(ctx context.Context) (unionId string, ok bool)
- func InitDefaultTracer(serviceName string) error
- func InitTracer(tracerType string, serviceName string) error
- type Config
- type Configurator
- type ContextController
- type ContextHeader
- type EtcdConfig
- type Head
- type SimpleConfig
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 InitDefaultTracer ¶
func InitTracer ¶
Types ¶
type Configurator ¶
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 SimpleConfig ¶
type SimpleConfig struct { }
func (*SimpleConfig) GetConfig ¶
func (m *SimpleConfig) GetConfig(serviceName string) *Config
Click to show internal directories.
Click to hide internal directories.