Documentation ¶
Index ¶
- Variables
- func GetTraceIdFromCache(key int64) string
- func InitTracer(url string, serviceName string) error
- func NewCacheTraceId() *traceIdCache
- func SetClientSpan(ctx context.Context, span trace.Span, m interface{})
- func SetServerSpan(ctx context.Context, span trace.Span, m interface{})
- func SpanID(ctx context.Context) string
- func TraceID(ctx context.Context) string
- type ClientHandler
- func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
- func (c *ClientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (c *ClientHandler) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context
- type Metadata
- type Option
- type Tracer
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheTraceId *traceIdCache
Functions ¶
func GetTraceIdFromCache ¶
func NewCacheTraceId ¶
func NewCacheTraceId() *traceIdCache
Types ¶
type ClientHandler ¶
type ClientHandler struct{}
ClientHandler is tracing ClientHandler
func (*ClientHandler) HandleConn ¶
func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)
HandleConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) HandleRPC ¶
func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
HandleRPC implements per-RPC tracing and stats instrumentation.
func (*ClientHandler) TagConn ¶
func (c *ClientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
TagConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) TagRPC ¶
func (c *ClientHandler) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context
TagRPC implements per-RPC context management.
type Metadata ¶
type Metadata struct{}
Metadata is tracing metadata propagator
func (Metadata) Extract ¶
func (b Metadata) Extract(parent context.Context, carrier propagation.TextMapCarrier) context.Context
Extract returns a copy of parent with the metadata from the carrier added.
func (Metadata) Inject ¶
func (b Metadata) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject sets metadata key-values from ctx into the carrier.
type Option ¶
type Option func(*options)
Option is tracing option.
func WithPropagator ¶
func WithPropagator(propagator propagation.TextMapPropagator) Option
WithPropagator with tracer propagator.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider with tracer provider. By default, it uses the global provider that is set by otel.SetTracerProvider(provider).
Click to show internal directories.
Click to hide internal directories.