Documentation ¶
Index ¶
- func GetTraceID(ctx context.Context) string
- func GetTraceURL(ctx context.Context) (u string)
- func InitOpenTracing(serviceName string, opts ...OptionFunc) error
- func Log(ctx context.Context, key string, value interface{})
- func LogEvent(ctx context.Context, event string, payload ...interface{})
- func SetError(ctx context.Context, err error)
- func SetTracerPlatformType(t PlatformType)
- func SkipTraceContext(ctx context.Context) context.Context
- func StartTrace(ctx context.Context, operationName string) interfaces.Tracer
- func StartTraceFromHeader(ctx context.Context, operationName string, header map[string]string) (interfaces.Tracer, context.Context)
- func StartTraceWithContext(ctx context.Context, operationName string) (interfaces.Tracer, context.Context)
- func WithTraceFunc(ctx context.Context, operationName string, ...)
- func WithTraceFuncTracer(ctx context.Context, operationName string, fn func(t interfaces.Tracer))
- type Option
- type OptionFunc
- type PlatformType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitOpenTracing ¶
func InitOpenTracing(serviceName string, opts ...OptionFunc) error
InitOpenTracing init jaeger tracing
func SetTracerPlatformType ¶ added in v1.9.3
func SetTracerPlatformType(t PlatformType)
SetTracerPlatformType function for set tracer platform
func SkipTraceContext ¶
SkipTraceContext inject to context for skip span tracer
func StartTrace ¶
func StartTrace(ctx context.Context, operationName string) interfaces.Tracer
StartTrace starting trace child span from parent span
func StartTraceFromHeader ¶ added in v1.9.3
func StartTraceFromHeader(ctx context.Context, operationName string, header map[string]string) (interfaces.Tracer, context.Context)
StartTraceFromHeader starting trace from root app handler based on header
func StartTraceWithContext ¶ added in v1.0.9
func StartTraceWithContext(ctx context.Context, operationName string) (interfaces.Tracer, context.Context)
StartTraceWithContext starting trace child span from parent span, returning tracer and context
func WithTraceFunc ¶
func WithTraceFunc(ctx context.Context, operationName string, fn func(context.Context, map[string]interface{}))
WithTraceFunc functional with context and tags in function params
func WithTraceFuncTracer ¶
func WithTraceFuncTracer(ctx context.Context, operationName string, fn func(t interfaces.Tracer))
WithTraceFuncTracer functional with Tracer instance in function params
Types ¶
type OptionFunc ¶ added in v1.6.8
type OptionFunc func(*Option)
OptionFunc func
func OptionSetAgentHost ¶ added in v1.6.8
func OptionSetAgentHost(agent string) OptionFunc
OptionSetAgentHost option func
func OptionSetBuildNumberTag ¶ added in v1.6.8
func OptionSetBuildNumberTag(number string) OptionFunc
OptionSetBuildNumberTag option func
func OptionSetLevel ¶ added in v1.6.8
func OptionSetLevel(level string) OptionFunc
OptionSetLevel option func
func OptionSetMaxGoroutineTag ¶ added in v1.6.8
func OptionSetMaxGoroutineTag(max int) OptionFunc
OptionSetMaxGoroutineTag option func
type PlatformType ¶ added in v1.9.3
type PlatformType interface { StartSpan(ctx context.Context, opName string) interfaces.Tracer StartRootSpan(ctx context.Context, operationName string, header map[string]string) interfaces.Tracer }
PlatformType define tracing platform. example using jaeger, sentry, aws x-ray, etc