traces

package
v0.148.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLocalProvider

func InitLocalProvider(ctx context.Context, config Config, exportToConsole bool) (func(ctx context.Context) error, error)

InitLocalProvider creates an OpenTelemetry provider for the concrete service. If exportToConsole is `true`, the traces will be written in the console for debugging purposes.

func InitProvider

func InitProvider(ctx context.Context, config Config) (func(ctx context.Context) error, error)

InitProvider creates an OpenTelemetry provider for the concrete service. If the collector in the destination endpoint isn't reachable, then the init function will return an error.

Types

type Config

type Config struct {
	// ServiceName is the name of the instrumented library/service
	ServiceName string
	// ServiceVersion is the version of the instrumented library/service
	// It must be in Semver format `<MAYOR>.<MINOR>.<PATCH>`
	ServiceVersion string
	// Endpoint is the target of the collector.
	// Must be in the format `<DOMAIN>:<PORT>` without prefixed protocol
	// Ignored in the case of a LocalProvider
	Endpoint string
}

Jump to

Keyboard shortcuts

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