Versions in this module Expand all Collapse all v0 v0.1.0 Aug 27, 2026 Changes in this version + const DefaultBatchSize + const DefaultBatchWindow + const DefaultBufferCapacity + const DefaultCardinalityMark + const DefaultCardinalityWindow + const DefaultCooldown + const DefaultExportTimeout + const DefaultExportWorkers + const DefaultFailureThreshold + const DefaultHalfOpenSuccesses + const DefaultInitialBackoff + const DefaultMaxAttributes + const DefaultMaxBackoff + const DefaultMaxBodyBytes + const DefaultMaxDistinctValues + const DefaultMaxKeyBytes + const DefaultMaxTrackedKeys + const DefaultMaxValueBytes + const DefaultMetricLabelCap + const DefaultRetryAttempts + const DefaultSkewThreshold + const DefaultTruncationMark + const DefaultUnsupportedMark + const OverflowLabel + const RedactionMark + const SampleNothing + const UnattributedSource + var BodyPatterns = []string + var ErrBufferClosed = errors.New("buffer closed") + var ErrBufferFull = errors.New("buffer full") + var ErrCircuitOpen = errors.New("circuit open") + var ErrPermanent = errors.New("permanent export failure") + var ErrRedactionFailed = errors.New("redaction failed") + var ErrSourceQuotaExhausted = errors.New("source quota exhausted") + var SensitiveKeySubstrings = []string + func IsPermanent(err error) bool + type BatchMutator interface + MutatesBatch func() bool + type BufferStore interface + Close func() error + Depth func() int + DequeueBatch func(ctx context.Context) ([]LogRecord, error) + Enqueue func(ctx context.Context, rec LogRecord) error + type CardinalityGuard struct + Mark string + MaxDistinctValues int + MaxTrackedKeys int + Metrics Metrics + Now func() time.Time + Window time.Duration + func (g *CardinalityGuard) Apply(rec *LogRecord) + func (g *CardinalityGuard) Observe(key, value string) bool + func (g *CardinalityGuard) TrackedKeys() int + type CircuitBreaker struct + func NewCircuitBreaker(cfg CircuitBreakerConfig) (*CircuitBreaker, error) + func (cb *CircuitBreaker) Export(ctx context.Context, batch []LogRecord) error + func (cb *CircuitBreaker) MutatesBatch() bool + func (cb *CircuitBreaker) Name() string + func (cb *CircuitBreaker) Open() bool + func (cb *CircuitBreaker) Shutdown(ctx context.Context) error + func (cb *CircuitBreaker) State() CircuitState + type CircuitBreakerConfig struct + Cooldown time.Duration + Exporter Exporter + FailureThreshold int + HalfOpenSuccesses int + Metrics Metrics + Name string + Now func() time.Time + type CircuitReporter interface + Name func() string + Open func() bool + type CircuitState int + const CircuitClosed + const CircuitHalfOpen + const CircuitOpen + func (s CircuitState) String() string + type CountingMetrics struct + LabelCap int + func (m *CountingMetrics) AttributeDropped(key string) + func (m *CountingMetrics) AttributeTruncated(key string) + func (m *CountingMetrics) BufferDepth(depth int) + func (m *CountingMetrics) CardinalityCapped(key string) + func (m *CountingMetrics) CircuitStateChanged(exporter string, open bool) + func (m *CountingMetrics) ClockSkew(source string, deviation time.Duration) + func (m *CountingMetrics) DeprecatedWireVersion(version string) + func (m *CountingMetrics) ExportDegraded(degraded bool) + func (m *CountingMetrics) ExportLatency(exporter string, d time.Duration) + func (m *CountingMetrics) ExportRetried(exporter string) + func (m *CountingMetrics) IdentityDiscrepancy(_, actual string) + func (m *CountingMetrics) RecordsDropped(source string, reason DropReason, n int) + func (m *CountingMetrics) RecordsExported(exporter string, n int) + func (m *CountingMetrics) RecordsFiltered(source string, n int) + func (m *CountingMetrics) RecordsIngested(source string, n int) + func (m *CountingMetrics) Snapshot() Snapshot + func (m *CountingMetrics) TimestampMissing(source string) + type Crier struct + func New(opts Options) (*Crier, error) + func (c *Crier) Depth() int + func (c *Crier) Health() *Health + func (c *Crier) Log(ctx context.Context, rec LogRecord) error + func (c *Crier) LogBatch(ctx context.Context, batch []LogRecord) (accepted int, err error) + func (c *Crier) Shutdown(ctx context.Context) (DrainSummary, error) + type Destination struct + Exporter Exporter + Name string + type Dispatcher struct + func NewDispatcher(cfg DispatcherConfig) (*Dispatcher, error) + func (d *Dispatcher) Degraded() bool + func (d *Dispatcher) Draining() bool + func (d *Dispatcher) OpenCircuits() []string + func (d *Dispatcher) Shutdown(ctx context.Context) (DrainSummary, error) + func (d *Dispatcher) Start(ctx context.Context) + type DispatcherConfig struct + Buffer BufferStore + Circuits []CircuitReporter + Exporter Exporter + Metrics Metrics + Workers int + type DrainSummary struct + Destinations []string + Duration time.Duration + Lost int + OpenCircuits []string + func (s DrainSummary) Clean() bool + func (s DrainSummary) String() string + type DropKey struct + Reason DropReason + Source string + type DropPolicy int + const DropPolicyBlock + const DropPolicyDropOldest + const DropPolicyReject + func (p DropPolicy) String() string + func (p DropPolicy) Valid() bool + type DropReason string + const DropBackendUnavailable + const DropBufferFull + const DropInvalid + const DropOldest + const DropRedactionFailed + const DropShutdownTimeout + const DropSourceQuota + type Exporter interface + Export func(ctx context.Context, batch []LogRecord) error + Shutdown func(ctx context.Context) error + type FairShareBuffer struct + func NewFairShareBuffer(inner BufferStore, cfg FairShareConfig) (*FairShareBuffer, error) + func (f *FairShareBuffer) Close() error + func (f *FairShareBuffer) Depth() int + func (f *FairShareBuffer) DequeueBatch(ctx context.Context) ([]LogRecord, error) + func (f *FairShareBuffer) Enqueue(ctx context.Context, rec LogRecord) error + func (f *FairShareBuffer) SpareInUse() int + func (f *FairShareBuffer) UnlistedInUse() int + func (f *FairShareBuffer) Usage(source string) int + type FairShareConfig struct + Metrics Metrics + Reservations map[string]int + UnlistedPool int + type FanOut struct + func NewFanOut(cfg FanOutConfig) (*FanOut, error) + func (f *FanOut) Destinations() int + func (f *FanOut) Export(ctx context.Context, batch []LogRecord) error + func (f *FanOut) Names() []string + func (f *FanOut) Shutdown(ctx context.Context) error + type FanOutConfig struct + Destinations []Destination + Metrics Metrics + Timeout time.Duration + type FanOutError struct + Dispatched int + Failures map[string]error + func (e *FanOutError) AllFailed() bool + func (e *FanOutError) Error() string + func (e *FanOutError) Partial() bool + func (e *FanOutError) Unwrap() []error + type Filter struct + Metrics Metrics + MinSeverity Severity + PerSource map[string]SourceFilter + Rand func() float64 + SampleFloor Severity + SampleRate float64 + func (f *Filter) Keep(rec *LogRecord, source string) bool + func (f *Filter) KeepBatch(batch []LogRecord, source string) []LogRecord + func (f *Filter) Validate() error + type Health struct + func NewHealth(dispatcher *Dispatcher) (*Health, error) + func (h *Health) Live() bool + func (h *Health) Ready() (ready bool, reason string) + type LatencyStat struct + Count int64 + Max time.Duration + Total time.Duration + func (s LatencyStat) Mean() time.Duration + type Limits struct + MaxAttributes int + MaxBodyBytes int + MaxKeyBytes int + MaxValueBytes int + Metrics Metrics + TruncationMark string + UnsupportedMark string + func (l Limits) Apply(rec *LogRecord) + type LogRecord struct + Attributes map[string]any + Body string + ObservedTimestamp time.Time + Resource Resource + Severity Severity + SeverityText string + SpanID string + Timestamp time.Time + TraceID string + func (rec LogRecord) Clone() LogRecord + func (rec LogRecord) EffectiveTime() time.Time + type MemoryBuffer struct + func NewMemoryBuffer(cfg MemoryBufferConfig) (*MemoryBuffer, error) + func (b *MemoryBuffer) Capacity() int + func (b *MemoryBuffer) Close() error + func (b *MemoryBuffer) Depth() int + func (b *MemoryBuffer) DequeueBatch(ctx context.Context) ([]LogRecord, error) + func (b *MemoryBuffer) Enqueue(ctx context.Context, rec LogRecord) error + func (b *MemoryBuffer) EnqueueFrom(ctx context.Context, rec LogRecord, source string) error + type MemoryBufferConfig struct + BatchSize int + BatchWindow time.Duration + Capacity int + Metrics Metrics + Policy DropPolicy + type Metrics interface + AttributeDropped func(key string) + AttributeTruncated func(key string) + BufferDepth func(depth int) + CardinalityCapped func(key string) + CircuitStateChanged func(exporter string, open bool) + ClockSkew func(source string, deviation time.Duration) + DeprecatedWireVersion func(version string) + ExportDegraded func(degraded bool) + ExportLatency func(exporter string, d time.Duration) + ExportRetried func(exporter string) + IdentityDiscrepancy func(claimed, actual string) + RecordsDropped func(source string, reason DropReason, n int) + RecordsExported func(exporter string, n int) + RecordsFiltered func(source string, n int) + RecordsIngested func(source string, n int) + TimestampMissing func(source string) + type NopMetrics struct + func (NopMetrics) AttributeDropped(string) + func (NopMetrics) AttributeTruncated(string) + func (NopMetrics) BufferDepth(int) + func (NopMetrics) CardinalityCapped(string) + func (NopMetrics) CircuitStateChanged(string, bool) + func (NopMetrics) ClockSkew(string, time.Duration) + func (NopMetrics) DeprecatedWireVersion(string) + func (NopMetrics) ExportDegraded(bool) + func (NopMetrics) ExportLatency(string, time.Duration) + func (NopMetrics) ExportRetried(string) + func (NopMetrics) IdentityDiscrepancy(string, string) + func (NopMetrics) RecordsDropped(string, DropReason, int) + func (NopMetrics) RecordsExported(string, int) + func (NopMetrics) RecordsFiltered(string, int) + func (NopMetrics) RecordsIngested(string, int) + func (NopMetrics) TimestampMissing(string) + type Normalizer struct + Metrics Metrics + Now func() time.Time + SkewThreshold time.Duration + func (n *Normalizer) Normalize(rec *LogRecord, source string) + func (n *Normalizer) NormalizeBatch(batch []LogRecord, source string) + type Options struct + BatchSize int + BatchWindow time.Duration + Capacity int + Cardinality *CardinalityGuard + Cooldown time.Duration + DropPolicy DropPolicy + ExportTimeout time.Duration + Exporters map[string]Exporter + FailureThreshold int + Filter *Filter + Limits Limits + Metrics Metrics + Redactor *Redactor + RetryAttempts int + ServiceName string + ServiceVersion string + Workers int + type Pipeline struct + func NewPipeline(cfg PipelineConfig) (*Pipeline, error) + func (p *Pipeline) Admit(ctx context.Context, rec LogRecord, source string) error + func (p *Pipeline) AdmitBatch(ctx context.Context, batch []LogRecord, source string) (admitted int, firstErr error) + func (p *Pipeline) Buffer() BufferStore + type PipelineConfig struct + Buffer BufferStore + Cardinality *CardinalityGuard + Filter *Filter + Limits Limits + Metrics Metrics + Normalizer *Normalizer + Redactor *Redactor + type RedactionConfig struct + BodyPatterns []string + KeyPatterns []string + KeySubstrings []string + Metrics Metrics + SkipBody bool + type Redactor struct + func NewRedactor(cfg RedactionConfig) (*Redactor, error) + func (r *Redactor) Redact(rec *LogRecord, source string) error + func (r *Redactor) RedactString(s string) string + type Resource struct + Attributes map[string]any + ServiceName string + ServiceVersion string + func (r Resource) Clone() Resource + type Retry struct + func NewRetry(cfg RetryConfig) (*Retry, error) + func (r *Retry) Export(ctx context.Context, batch []LogRecord) error + func (r *Retry) MutatesBatch() bool + func (r *Retry) Shutdown(ctx context.Context) error + type RetryConfig struct + Exporter Exporter + InitialBackoff time.Duration + MaxAttempts int + MaxBackoff time.Duration + Metrics Metrics + Name string + Rand func() float64 + type RetryHint interface + RetryAfter func() time.Duration + type Severity int + const SeverityDebug + const SeverityError + const SeverityFatal + const SeverityInfo + const SeverityTrace + const SeverityUnspecified + const SeverityWarn + func (s Severity) String() string + func (s Severity) Valid() bool + type Snapshot struct + AttributesDropped map[string]int64 + AttributesTruncated map[string]int64 + BufferDepth int + CardinalityCapped map[string]int64 + ClockSkew map[string]LatencyStat + Degraded bool + DegradedTransitions int64 + DeprecatedWireVersion map[string]int64 + Dropped map[DropKey]int64 + ExportLatency map[string]LatencyStat + Exported map[string]int64 + Filtered map[string]int64 + IdentityDiscrepancies map[string]int64 + Ingested map[string]int64 + OpenCircuits map[string]bool + Retries map[string]int64 + TimestampMissing map[string]int64 + func (s Snapshot) DroppedBy(reason DropReason) int64 + func (s Snapshot) TotalDropped() int64 + type SourceFilter struct + MinSeverity *Severity + SampleRate *float64