tracing

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: BSD-3-Clause-Clear Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName           = "opentdf-platform"
	ProviderOTLP          = "otlp"
	ProviderFile          = "file"
	DefaultFileMaxSize    = 20
	DefaultFileMaxBackups = 10
	DefaultFileMaxAge     = 30
	ShutdownTimeout       = 5 * time.Second // Added constant for shutdown timeout
)

Variables

This section is empty.

Functions

func ConnectClientTraceInterceptor added in v0.14.0

func ConnectClientTraceInterceptor() (connect.Interceptor, error)

ConnectClientTraceInterceptor returns a Connect interceptor backed by otelconnect that injects OpenTelemetry trace context into outbound requests and creates per-RPC spans and metrics.

func ConnectServerTraceInterceptor added in v0.14.0

func ConnectServerTraceInterceptor() (connect.Interceptor, error)

ConnectServerTraceInterceptor returns a Connect interceptor backed by otelconnect that extracts OpenTelemetry trace context from incoming requests and creates per-RPC spans and metrics.

WithTrustRemote makes server spans children of the incoming trace rather than linked root spans. WithoutServerPeerAttributes reduces cardinality.

func InitTracer

func InitTracer(ctx context.Context, cfg Config) (func(), error)

func InjectTraceContext added in v0.5.3

func InjectTraceContext(ctx context.Context) context.Context

Types

type Config

type Config struct {
	Enabled  bool           `json:"enabled" yaml:"enabled"`
	Provider ProviderConfig `json:"provider" yaml:"provider"`
}

type FileConfig added in v0.5.3

type FileConfig struct {
	Path        string `json:"path" yaml:"path"`
	PrettyPrint bool   `json:"prettyPrint,omitempty" yaml:"prettyPrint,omitempty"`
	MaxSize     int    `json:"maxSize,omitempty" yaml:"maxSize,omitempty"`
	MaxBackups  int    `json:"maxBackups,omitempty" yaml:"maxBackups,omitempty"`
	MaxAge      int    `json:"maxAge,omitempty" yaml:"maxAge,omitempty"`
	Compress    bool   `json:"compress,omitempty" yaml:"compress,omitempty"`
}

type OTLPConfig added in v0.5.3

type OTLPConfig struct {
	Endpoint string            `json:"endpoint" yaml:"endpoint"`
	Insecure bool              `json:"insecure" yaml:"insecure"`
	Protocol string            `json:"protocol,omitempty" yaml:"protocol,omitempty"`
	Headers  map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}

type ProviderConfig added in v0.5.3

type ProviderConfig struct {
	Name string      `json:"name" yaml:"name"`
	OTLP *OTLPConfig `json:"otlp,omitempty" yaml:"otlp,omitempty"`
	File *FileConfig `json:"file,omitempty" yaml:"file,omitempty"`
}

Jump to

Keyboard shortcuts

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