tracing

package
v3.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package tracing provides tools for working with tracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) otrace.TracerProvider

FromContext returns the tracer provider that is attached to the context or returns a noop tracer provider if it does not exist.

func Initialize

func Initialize(ctx context.Context, config *Config) (otrace.TracerProvider, func(context.Context) error, error)

Initialize initializes the tracing package and returns the tracer provider. If tracing is not enabled it returns a noop tracer provider instead.

func NewContextWithTracerProvider

func NewContextWithTracerProvider(ctx context.Context, tp otrace.TracerProvider) context.Context

NewContextWithTracerProvider returns a derived context with the tracer provider set.

Types

type CollectorConfig

type CollectorConfig struct {
	EndpointURL string           `name:"endpoint-url" description:"The URL of the collector endpoint"`
	Insecure    bool             `name:"insecure" description:"Use insecure connection"`
	TLS         tlsconfig.Client `name:"tls"`
}

CollectorConfig represents configuration for the trace collector exporter.

type Config

type Config struct {
	Enable            bool            `name:"enable" description:"Enable telemetry"`
	Exporter          string          `name:"exporter" description:"Telemetry exporter (otlp, writer)"`
	CollectorConfig   CollectorConfig `name:"collector-config" description:"Trace collector exporter configuration"`
	WriterConfig      WriterConfig    `name:"writer-config" description:"Writer exporter configuration"`
	SampleProbability float64         `` //nolint:lll
	/* 130-byte string literal not displayed */
}

Config represents configuration for OpenTelemetry tracing.

type WriterConfig

type WriterConfig struct {
	Destination string `name:"destination" description:"Destination of telemetry writer (stdout, stderr)"`
	Timestamps  bool   `name:"timestamps" description:"Print timestamps"`
	Pretty      bool   `name:"pretty" description:"Human readable format"`
}

WriterConfig represents configuration for the stdout exporter.

Directories

Path Synopsis
Package tracer provides mechanisms to propagate tracer in context.
Package tracer provides mechanisms to propagate tracer in context.

Jump to

Keyboard shortcuts

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