trace

package
v0.0.0-...-cbc6a02 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartSpanFromContext = opentracing.StartSpanFromContext

Functions

func DefaultTransport

func DefaultTransport() *http.Transport

func DoPost

func DoPost(ctx context.Context, url string, req interface{}, v interface{}) error

func DoRequest

func DoRequest(ctx context.Context, tr *http.Transport, req *http.Request, v interface{}) error

func GetContextFrom

func GetContextFrom(c *gin.Context) (ctx context.Context)

ContextWithSpan 返回context

func GetGinContext

func GetGinContext(ctx context.Context) *gin.Context

func GetParentIDFromSpan

func GetParentIDFromSpan(ctx context.Context) string

func GetSpanIDFromContext

func GetSpanIDFromContext(ctx context.Context) string

func GetTraceFieldFrom

func GetTraceFieldFrom(ctx context.Context) []interface{}

func GetTraceIDFromContext

func GetTraceIDFromContext(ctx context.Context) string

func GetUrlFromContext

func GetUrlFromContext(ctx context.Context) string

func NewTracer

func NewTracer(serviceName string, addr string) (opentracing.Tracer, io.Closer, error)

NewTracer 创建一个jaeger Tracer

func OpenTracingClientInterceptor

func OpenTracingClientInterceptor() grpc.UnaryClientInterceptor

func OpenTracingServerInterceptor

func OpenTracingServerInterceptor() grpc.UnaryServerInterceptor

func SetSamplingFrequency

func SetSamplingFrequency(n int)

SetSamplingFrequency 设置采样频率 0 <= n <= 100

func StartSpan

func StartSpan(ctx context.Context, operationName string, f func() error, opts ...opentracing.StartSpanOption) (context.Context, error)

func TracerWrapper

func TracerWrapper(c *gin.Context)

TracerWrapper tracer 中间件

Types

This section is empty.

Jump to

Keyboard shortcuts

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