span

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EchoSpan echo span
	SystemCall = "braid.system.call.span"
)

Variables

This section is empty.

Functions

func ClientInterceptor

func ClientInterceptor(tracer opentracing.Tracer) grpc.UnaryClientInterceptor

ClientInterceptor rpc拦截器

func CreateCallSpan

func CreateCallSpan(opts ...SpanOption) tracer.SpanFactory

CreateCallSpan

func ServerInterceptor

func ServerInterceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor

ServerInterceptor server端rpc拦截器

Types

type MDReaderWriter

type MDReaderWriter struct {
	metadata.MD
}

MDReaderWriter metadata 读写

func (MDReaderWriter) ForeachKey

func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error

ForeachKey 为了 opentracing.TextMapReader ,参考 opentracing 代码

func (MDReaderWriter) Set

func (c MDReaderWriter) Set(key, val string)

Set 为了 opentracing.TextMapWriter,参考 opentracing 代码

type SpanOption

type SpanOption func(*SpanParm)

func WithNodeID

func WithNodeID(id string) SpanOption

type SpanParm

type SpanParm struct {
	// contains filtered or unexported fields
}

type SystemCallTracer

type SystemCallTracer struct {
	// contains filtered or unexported fields
}

EchoTracer http request tracer

func (*SystemCallTracer) Begin

func (t *SystemCallTracer) Begin(ctx interface{}) context.Context

Begin starts the span and returns the updated context

func (*SystemCallTracer) End

func (t *SystemCallTracer) End(ctx interface{})

End finishes the span

func (*SystemCallTracer) GetID

func (t *SystemCallTracer) GetID() string

func (*SystemCallTracer) SetTag

func (t *SystemCallTracer) SetTag(key string, val interface{})

Jump to

Keyboard shortcuts

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