Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder fans out OTLP payloads to one or more upstream HTTP endpoints.
func New ¶
New returns a Forwarder in fire-and-forget mode (no spool, no retry). urls should be bare base URLs, e.g. "http://tempo:4318". sample is the per-payload forwarding probability in [0, 1]; values outside the range are clamped (NaN → 1.0).
func NewWithSpool ¶ added in v0.2.0
func NewWithSpool(urls []string, sample float64, sc SpoolConfig) *Forwarder
NewWithSpool returns a Forwarder backed by a per-upstream disk spool. Failed deliveries are retried with exponential backoff (250ms → sc.RetryMax). Each upstream gets a send-loop goroutine that runs for the process lifetime.
type SpoolConfig ¶ added in v0.2.0
type SpoolConfig struct {
Dir string // spool directory; default: ~/.spaniel/forward
MaxBytes int64 // max pending bytes per upstream; default: 100 MB
RetryMax time.Duration // max backoff between retries; default: 30s
}
SpoolConfig controls the disk-backed retry buffer. Zero values cause NewWithSpool to use its built-in defaults.
type Status ¶
type Status struct {
URL string `json:"url"`
Sent int64 `json:"sent"`
Errors int64 `json:"errors"`
Skipped int64 `json:"skipped"`
LastErr string `json:"last_error,omitempty"`
PendingBytes int64 `json:"pending_bytes,omitempty"`
DroppedSpool int64 `json:"dropped_spool,omitempty"`
LastFailureAt int64 `json:"last_failure_at,omitempty"`
BackoffNs int64 `json:"backoff_ns,omitempty"`
}
Status is the serialisable snapshot of one upstream's counters.