Documentation
¶
Overview ¶
Package otelutil holds the shared plumbing behind framingo's telemetry services (tracing, metrics): the name-to-factory Registry their exporter subpackages register into from init(), and the transport-agnostic otlp config vocabulary (Duration, Retry, Config, the strict Decode) their factories build exporters from. Signal-specific knobs layer on top in the signal's own package - tracing's exporters/model wraps Config with the span-exporter-only max_request_size, which is why it is absent here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Endpoint string `yaml:"endpoint"` // host:port, no scheme
Insecure bool `yaml:"insecure"`
Headers map[string]string `yaml:"headers"`
Compression string `yaml:"compression"` // "gzip", or ""/"none"
Timeout Duration `yaml:"timeout"`
Retry *Retry `yaml:"retry"`
}
Config is the transport-agnostic half of the otlp exporter surface. A zero field leaves the exporter's own default in place. Knobs that carry grpc or http types (dial options, connections, proxies) are deliberately absent - an exporter needing those is an app-registered Factory instead, whose closure captures whatever construction requires.
type Duration ¶
Duration decodes a Go duration string ("5s", "1m30s") from yaml, which yaml.v3 does not do for time.Duration itself.
type Registry ¶
type Registry[F any] struct { // contains filtered or unexported fields }
Registry is the name-to-factory registry behind pluggable implementations that register themselves from subpackage init()s - the discipline the tracing and metrics exporter registries share: Register panics on a duplicate name so misconfiguration surfaces at startup, and a failed Lookup names the blank-import that would have provided it.
func NewRegistry ¶
type Retry ¶
type Retry struct {
// Enabled defaults to true when the retry block is present - writing
// intervals is opting in, matching otlp's own retry-on default.
Enabled *bool `yaml:"enabled"`
InitialInterval Duration `yaml:"initial_interval"`
MaxInterval Duration `yaml:"max_interval"`
MaxElapsedTime Duration `yaml:"max_elapsed_time"`
}
Retry mirrors the otlp exporters' retry settings (their RetryConfig types are per-package aliases of the same shape).