tracing

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracerProvider

func NewTracerProvider(cfg Config, opts ...sdktrace.TracerProviderOption) (*sdktrace.TracerProvider, error)

NewTracerProvider builds and registers a global TracerProvider.

func Shutdown

func Shutdown(ctx context.Context, tp *sdktrace.TracerProvider) error

Shutdown flushes and stops the provider.

Types

type Config

type Config struct {
	Exporter Exporter
	// ServiceName is attached to exported spans. Defaults to "unknown_service".
	ServiceName string
	// CloudTraceProject is required when Exporter is ExporterCloudTrace.
	CloudTraceProject string
	// StdoutWriter defaults to os.Stderr when Exporter is ExporterStdout.
	StdoutWriter io.Writer
	// PrettyStdout enables human-readable stdout output.
	PrettyStdout bool
	// OTLPEndpoint is required when Exporter is ExporterOTLP (for example localhost:4317).
	OTLPEndpoint string
	// OTLPInsecure disables TLS for OTLP/gRPC (typical for local collectors).
	OTLPInsecure bool
}

Config configures a TracerProvider for Spanner client tracing.

type Exporter

type Exporter string

Exporter selects where spans are exported.

const (
	ExporterCloudTrace Exporter = "cloud-trace"
	ExporterStdout     Exporter = "stdout"
	ExporterOTLP       Exporter = "otlp"
)

Jump to

Keyboard shortcuts

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