tracer

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 2 Imported by: 10

Documentation

Index

Constants

View Source
const (
	PackageName = "go-tracing"
)
View Source
const (
	Version = "v1.1.2"
)

Variables

View Source
var NullSpan = nullSpan{}

NullSpan is a null tracing span.

View Source
var NullSpanContext = nullSpanCotext{}

NullSpanContext is a null tracing span context.

View Source
var NullTracer = &nullTacer{}

NullTracer is a null tracing tracer.

Functions

func TestTracer

func TestTracer(t *testing.T, tracer Tracer)

Types

type Context added in v1.1.0

type Context interface {
	// Span returns the current top tracer span on the tracer span stack.
	Span() Span
	// StartSpan starts a new child tracer span and pushes it onto the tracer span stack.
	StartSpan(name string) bool
	// FinishSpan ends the current top tracer span and pops it from the tracer span stack.
	FinishSpan() bool
}

Context represents a span context.

type Span

type Span interface {
	// SetTag sets a tag on the span.
	SetTag(key string, value any)
	// Finish marks the end of the span.
	Finish()
	// Context returns the span's context.
	Context() context.Context
	// StartSpan starts a new child span.
	StartSpan(name string) Context
}

type Tracer

type Tracer interface {
	// SetPackageName sets a package name.
	SetPackageName(name string)
	// SetServiceName sets a service name.
	SetServiceName(name string)
	// SetEndpoint sets an endpoint.
	SetEndpoint(endpoint string)
	// PackageName returns the package name.
	PackageName() string
	// ServiceName returns the service name.
	ServiceName() string
	// Endpoint returns the endpoint.
	Endpoint() string
	// StartSpan starts a new span.
	StartSpan(name string) Context
	// Start starts a tracer.
	Start() error
	// Stop stops a tracer.
	Stop() error
}

func NewNullTracer added in v0.8.1

func NewNullTracer() Tracer

NewNullTracer returns a new null tracing tracer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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