trace

package
v8.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartVersion = "0"
)

Variables

This section is empty.

Functions

func New added in v8.0.7

func New() context.Context

New return root trace context. Compatible with old version.

func NewChild

func NewChild(ctx context.Context) context.Context

NewChild return child trace context. Return root trace context if parent not specified.

func NewContext

func NewContext() context.Context

NewContext return root trace context.

func NewRequest

func NewRequest(req *http.Request) context.Context

NewRequest create trace context based on http request.

Types

type Tracing

type Tracing struct {
	ParentSpanId string
	SpanId       string
	TraceId      string
	Version      string

	Http                              bool
	HttpHeaders                       map[string][]string
	HttpProtocol                      string
	HttpRequestMethod, HttpRequestUrl string
	HttpUserAgent                     string
	// contains filtered or unexported fields
}

Tracing mark open tracing.

func (*Tracing) GenVersion

func (o *Tracing) GenVersion(n int32) string

GenVersion return version number of trace.

return "0.0"		// First log of the same tracer
return "0.3.0"
return "0.3.1"

func (*Tracing) GetIncrement

func (o *Tracing) GetIncrement() int32

GetIncrement increment offset then return previous value.

func (*Tracing) GetOffset

func (o *Tracing) GetOffset() int32

GetOffset return current offset.

func (*Tracing) GetPrevious

func (o *Tracing) GetPrevious() int32

GetPrevious return previous offset value.

func (*Tracing) WithParent

func (o *Tracing) WithParent(p *Tracing) *Tracing

WithParent bind parent tracing to current.

Jump to

Keyboard shortcuts

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