opentracing

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIdKeyName      = "x-b3-traceid"
	SpanIdKeyName       = "x-b3-spanid"
	ParentSpanIdKeyName = "x-b3-parentspanid"
	SampledKeyName      = "x-b3-sampled"
	FlagsKeyName        = "x-b3-flags"
)
View Source
const (
	TraceHeader = "Opentracer-Info"
)

Variables

This section is empty.

Functions

func DelZipkin

func DelZipkin(logid string)

func ZipkinInit

func ZipkinInit(name string)

Types

type OpenTracing

type OpenTracing struct {
	ServerName string
}

func GetOpenTracing

func GetOpenTracing() *OpenTracing

func NewOpenTracing

func NewOpenTracing(name string) *OpenTracing

func (*OpenTracing) Dump

func (ot *OpenTracing) Dump()

func (*OpenTracing) EndChildSpan

func (ot *OpenTracing) EndChildSpan(index int)

func (*OpenTracing) EndChildSpanByDuration

func (ot *OpenTracing) EndChildSpanByDuration(index int, duration int64)

func (*OpenTracing) FromContextSetName

func (ot *OpenTracing) FromContextSetName(strContext, name string)

func (*OpenTracing) GetChildSpanContext

func (ot *OpenTracing) GetChildSpanContext(index int) (string, error)

func (*OpenTracing) SetChildTag

func (ot *OpenTracing) SetChildTag(index int, k, v string)

func (*OpenTracing) SetServerName

func (ot *OpenTracing) SetServerName(name string)

func (*OpenTracing) SetTag

func (ot *OpenTracing) SetTag(k, v string)

func (*OpenTracing) StartChildSpan

func (ot *OpenTracing) StartChildSpan(name string) (int, error)

返回Child Span的index,错误时index为小于0

type Span

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

func NewSpan

func NewSpan(name string) *Span

func (*Span) Finish

func (s *Span) Finish()

func (*Span) FinishByDuration

func (s *Span) FinishByDuration(duration int64)

func (*Span) GetContextStr

func (s *Span) GetContextStr() string

func (*Span) GetDuration

func (s *Span) GetDuration() int64

func (*Span) GetSampled

func (s *Span) GetSampled() uint8

func (*Span) GetSpanId

func (s *Span) GetSpanId() string

func (*Span) SetSampled

func (s *Span) SetSampled(sampled uint8)

func (*Span) SetSpanName

func (s *Span) SetSpanName(name string)

func (*Span) SetTag

func (s *Span) SetTag(k, v string)

type Zipkin

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

func NewZipkin

func NewZipkin(logid string) *Zipkin

func (*Zipkin) Clear

func (z *Zipkin) Clear()

func (*Zipkin) Dump

func (z *Zipkin) Dump() ([]map[string]interface{}, error)

func (*Zipkin) EndChildSpan

func (z *Zipkin) EndChildSpan(index int) error

func (*Zipkin) EndChildSpanByDuration

func (z *Zipkin) EndChildSpanByDuration(index int, duration int64) error

func (*Zipkin) GetChildSpanContextString

func (z *Zipkin) GetChildSpanContextString(index int) (string, error)

func (*Zipkin) SetChildTag

func (z *Zipkin) SetChildTag(k, v string, index int) error

func (*Zipkin) SetFromContext

func (z *Zipkin) SetFromContext(context string)

func (*Zipkin) SetName

func (z *Zipkin) SetName(name string)

func (*Zipkin) SetServerName

func (z *Zipkin) SetServerName(name string)

func (*Zipkin) SetTag

func (z *Zipkin) SetTag(k, v string) error

func (*Zipkin) StartChildSpan

func (z *Zipkin) StartChildSpan(name string) (int, error)

Jump to

Keyboard shortcuts

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