tracer

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: NCSA Imports: 18 Imported by: 62

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "0.2.0"
	BuildDate = "undefined"
	GitCommit = "undefined"
)
View Source
var (
	// Config holds the data read by rai-project/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 Provider

func Provider() string

func Register

func Register(name string, s Tracer, newFunc func(serviceName string) (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
	LIBRARY_TRACE
	HARDWARE_TRACE
	FULL_TRACE
)

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 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) error
	Name() string
	Level() Level
	SetLevel(Level)
	Endpoints() []string
}

func FromName

func FromName(s string) (Tracer, error)

func MustNew

func MustNew(serviceName string) Tracer

func New

func New(serviceName string) (Tracer, error)

func NewFromName

func NewFromName(serviceName, backendName string) (Tracer, error)

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