tracer

package
v1.466.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func Error added in v1.163.2

func Error(err error, span trace.Span)

Error for tracer.

func IsEnabled added in v1.143.2

func IsEnabled(cfg *Config) bool

IsEnabled for tracer.

func Meta added in v1.160.0

func Meta(ctx context.Context, span trace.Span)

Meta for tracer.

func OperationName added in v1.162.0

func OperationName(area, name string) string

OperationName for tracer.

func Register

func Register()

Register for tracer.

func WithTraceID added in v1.190.0

func WithTraceID(ctx context.Context, span trace.Span) context.Context

WithTraceID for tracer.

Types

type Config

type Config struct {
	Headers header.Map `yaml:"headers,omitempty" json:"headers,omitempty" toml:"headers,omitempty"`
	Kind    string     `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"`
	URL     string     `yaml:"url,omitempty" json:"url,omitempty" toml:"url,omitempty"`
}

Config for tracer.

type Params

type Params struct {
	fx.In
	Lifecycle   fx.Lifecycle
	FileSystem  os.FileSystem
	Config      *Config
	Environment env.Environment
	Version     env.Version
	Name        env.Name
}

Params for tracer.

type Tracer added in v1.457.0

type Tracer struct {
	trace.Tracer
}

Tracer using otel.

func NewTracer

func NewTracer(params Params) (*Tracer, error)

NewTracer for tracer.

func (*Tracer) StartClient added in v1.458.0

func (t *Tracer) StartClient(ctx context.Context, spanName string, attrs ...attribute.KeyValue) (context.Context, trace.Span)

StartClient starts a new client span.

func (*Tracer) StartServer added in v1.458.0

func (t *Tracer) StartServer(ctx context.Context, spanName string, attrs ...attribute.KeyValue) (context.Context, trace.Span)

StartServer starts a new server span.

Jump to

Keyboard shortcuts

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