trace

package
v0.0.0-...-c3afde3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 9 Imported by: 6

Documentation

Overview

Package trace provides tracing functionality.

Index

Constants

View Source
const (
	// EnvDevelopment is set to development.
	EnvDevelopment = "development"
	// EnvProduction is set to production.
	EnvProduction = "production"
)

Variables

This section is empty.

Functions

func GetTraceIDFromContext

func GetTraceIDFromContext(ctx context.Context) string

GetTraceIDFromContext gets trace id from context.

Types

type Config

type Config struct {
	OtelCollectorAddress string `env:"OPENTELEMETRY_COLLECTOR_ADDRESS,default=localhost:4317"`
	AppEnv               string `env:"APP_ENV,default=development"`
	ServiceName          string `env:"SERVICE_NAME,required"`
}

Config holds configuration for tracing.

type Provider

type Provider struct {
	otrace.TracerProvider
}

Provider provides tracing functionality.

func NewProvider

func NewProvider(ctx context.Context, cfg Config) (*Provider, error)

NewProvider creates an instance of Provider. func NewProvider(cfg Config, exporter sdktrace.SpanExporter) *Provider {

Jump to

Keyboard shortcuts

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