Documentation
¶
Index ¶
- func ContextWithSpan(parent context.Context, span trace.Span) context.Context
- func ContextWithTracer(ctx context.Context, tracer trace.Tracer) context.Context
- func Default() trace.TracerProvider
- func LoggerLabel(ctx context.Context) []zap.Field
- func Middleware(serviceName string, tracerProvider trace.TracerProvider) gin.HandlerFunc
- func NewWithConfig(ctx context.Context, cfg *Config, opts ...Option) (trace.TracerProvider, error)
- func SpanFromContext(ctx context.Context) trace.Span
- func StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- func Trace(ctx context.Context, config *configs.Config) error
- func TracerFromContext(ctx context.Context) trace.Tracer
- type Config
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶
ContextWithSpan 将span存入context
func ContextWithTracer ¶
func LoggerLabel ¶
LoggerLabel 从context中获取span信息,然后再取出信息返回[]zap.Field
func Middleware ¶
func Middleware(serviceName string, tracerProvider trace.TracerProvider) gin.HandlerFunc
Middleware 链路追踪中间件
func NewWithConfig ¶
func SpanFromContext ¶
SpanFromContext 从context中获取span
Types ¶
Click to show internal directories.
Click to hide internal directories.