tracer

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: NCSA Imports: 19 Imported by: 28

README

tracer

Common tracer abstraction

Build Status

References

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "1.0.5"
	BuildDate = "undefined"
	GitCommit = "undefined"
)
View Source
var (
	// Config holds the data read by c3sr/config
	Config = &tracerConfig{
		done:  make(chan struct{}),
		Level: NO_TRACE,
	}
)

Functions

func Close

func Close() error

func Enabled

func Enabled() bool

func Endpoints

func Endpoints() []string

func LevelToName added in v0.3.0

func LevelToName(l Level) string

func Provider

func Provider() string

func Register

func Register(name string, s Tracer, newFunc func(serviceName string, options ...Option) (Tracer, error))

func SetLevel

func SetLevel(lvl Level)

func SetStd

func SetStd(t Tracer)

func StartSpan

func StartSpan(lvl Level, operationName string, opts ...opentracing.StartSpanOption) opentracing.Span

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, lvl Level, operationName string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context)

func Tracers

func Tracers() []string

Types

type Level

type Level int32
const (
	NO_TRACE Level = iota
	APPLICATION_TRACE
	MODEL_TRACE
	FRAMEWORK_TRACE
	ML_LIBRARY_TRACE
	SYSTEM_LIBRARY_TRACE
	HARDWARE_TRACE
	FULL_TRACE

	LIBRARY_TRACE = ML_LIBRARY_TRACE
)

func GetLevel added in v0.3.0

func GetLevel() Level

func LevelFromName

func LevelFromName(s string) Level

func LevelString

func LevelString(s string) (Level, error)

LevelString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func LevelValues

func LevelValues() []Level

LevelValues returns all values of the enum

func (Level) IsALevel

func (i Level) IsALevel() bool

IsALevel returns "true" if the value is listed in the enum definition. "false" otherwise

func (Level) MarshalJSON

func (i Level) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Level

func (Level) MarshalText

func (i Level) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Level

func (Level) MarshalYAML

func (i Level) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for Level

func (*Level) Scan

func (i *Level) Scan(value interface{}) error

func (Level) String

func (i Level) String() string

func (*Level) UnmarshalJSON

func (i *Level) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Level

func (*Level) UnmarshalText

func (i *Level) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Level

func (*Level) UnmarshalYAML

func (i *Level) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for Level

func (Level) Value

func (i Level) Value() (driver.Value, error)

type Option added in v0.3.0

type Option = jaeger.TracerOption

type Tracer

type Tracer interface {
	opentracing.Tracer
	ID() string
	StartSpanFromContext(ctx context.Context, operationName string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context)
	io.Closer
	Init(serviceName string, opts ...Option) error
	Name() string
	Level() Level
	SetLevel(Level)
	Endpoints() []string
}

func FromName

func FromName(s string) (Tracer, error)

func MustNew

func MustNew(serviceName string, options ...Option) Tracer

func New

func New(serviceName string, options ...Option) (Tracer, error)

func NewFromName

func NewFromName(serviceName, backendName string, options ...Option) (Tracer, error)

func ResetStd added in v0.3.0

func ResetStd(options ...Option) Tracer

func Std

func Std() Tracer

Directories

Path Synopsis
grpc
`grpc_opentracing` adds OpenTracing OpenTracing Interceptors These are both client-side and server-side interceptors for OpenTracing.
`grpc_opentracing` adds OpenTracing OpenTracing Interceptors These are both client-side and server-side interceptors for OpenTracing.

Jump to

Keyboard shortcuts

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