tracer

package
v0.0.0-...-8993a07 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const JaegerType = Type("jaeger")

JaegerType allows use jaeger as tracer.

Variables

This section is empty.

Functions

func Init

func Init(log logger.Logger, cfg Config, opts ...Option) (service.Service, error)

Init configure tracer component and prepares it to work.

Types

type Config

type Config struct {
	Type    Type `env:"TYPE" default:"jaeger" usage:"allows to set trace exporter type"`
	Enabled bool `env:"ENABLED" default:"false" usage:"allows to enable tracing"`

	Jaeger
}

Config provides configuration for jaeger tracer.

type Jaeger

type Jaeger struct {
	Sampler       float64       `env:"SAMPLER" default:"1" usage:"allows to choose sampler"`
	Endpoint      string        `env:"ENDPOINT" usage:"allows to set jaeger endpoint (one of)" example:"http://localhost:14268/api/traces"`
	AgentHost     string        `env:"AGENT_HOST" usage:"allows to set jaeger agent host (one of)" example:"localhost"`
	AgentPort     string        `env:"AGENT_PORT" usage:"allows to set jaeger agent port" example:"6831"`
	RetryInterval time.Duration `env:"AGENT_RETRY_INTERVAL" default:"15s" usage:"allows to set retry connection timeout"`
}

Jaeger config options.

type JaegerPropagator

type JaegerPropagator = jaeger.Jaeger

JaegerPropagator propagator serializes SpanContext to/from Jaeger Headers Jaeger format: uber-trace-id: {trace-id}:{span-id}:{parent-span-id}:{flags}. Type alias.

type Option

type Option func(*customOptions)

Option allows to set custom options.

func WithCustomErrorHandler

func WithCustomErrorHandler(v otel.ErrorHandlerFunc) Option

WithCustomErrorHandler allows to set custom otel.ErrorHandlerFunc.

func WithJaegerServiceEnv

func WithJaegerServiceEnv(v string) Option

WithJaegerServiceEnv allows to set jaeger service environment.

func WithJaegerServiceName

func WithJaegerServiceName(v string) Option

WithJaegerServiceName allows to set jaeger service name.

func WithJaegerServiceVersion

func WithJaegerServiceVersion(v string) Option

WithJaegerServiceVersion allows to set jaeger service version.

type SpanProcessor

type SpanProcessor = trace.SpanProcessor

SpanProcessor type alias.

type Type

type Type string

Type of tracer component.

Jump to

Keyboard shortcuts

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