trace

package
v0.0.0-...-958c19f Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUndefindedTraceProto = fmt.Errorf("undefined trace protocol, available(http; grpc)")
)

Functions

func InitTraceProvider

func InitTraceProvider(ctx context.Context, serviceName, serviceVersion string, cnf Config) (func(context.Context) error, error)

Initializes an OTLP exporter, and configures the corresponding trace and metric providers.

Types

type Config

type Config struct {
	Proto    string
	Endpoint string
}

type Spaner

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

func (*Spaner) AddEvent

func (s *Spaner) AddEvent(name string, options ...trace.EventOption)

func (*Spaner) End

func (s *Spaner) End(opts ...trace.SpanEndOption)

func (*Spaner) IsRecording

func (s *Spaner) IsRecording() bool

func (*Spaner) RecordError

func (s *Spaner) RecordError(err error, options ...trace.EventOption)

func (*Spaner) SetAttributes

func (s *Spaner) SetAttributes(kv ...attribute.KeyValue)

func (*Spaner) SetName

func (s *Spaner) SetName(name string)

func (*Spaner) SetStatus

func (s *Spaner) SetStatus(code codes.Code, description string)

func (*Spaner) SpanContext

func (s *Spaner) SpanContext() trace.SpanContext

func (*Spaner) TracerProvider

func (s *Spaner) TracerProvider() trace.TracerProvider

type Tracer

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

func GetTracer

func GetTracer(name string, opts ...trace.TracerOption) *Tracer

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Jump to

Keyboard shortcuts

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