tracer

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(opts ...Option) (*tracesdk.TracerProvider, error)

NewProvider create an instance of tracer provider

func NewSpan

func NewSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

NewSpan returns a new span from the global tracer. span must be completed with `defer span.End()` right after the call.

func SpanFromContext

func SpanFromContext(ctx context.Context) trace.Span

SpanFromContext returns the current span from a context.

Types

type Config

type Config struct {
	// ServiceName customize service name
	ServiceName string `yaml:"serviceName"`
	// EndPoint the jaeger endpoint
	EndPoint string `yaml:"endpoint"`
	// InstanceID MUST be unique for each instance of the same
	InstanceID string `yaml:"instanceID"`
}

Config is the config for tracer

type Option

type Option func(ops *optionParams) error

Option the tracer provider option

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint defines the full URL to the Jaeger HTTP Thrift collector

func WithInstanceID

func WithInstanceID(instanceID string) Option

WithInstanceID defines the instance id

func WithServiceName

func WithServiceName(name string) Option

WithServiceName defines service name

Jump to

Keyboard shortcuts

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