Documentation
¶
Overview ¶
Package export is OpticTrace's pluggable output layer: every governed telemetry record (post-restriction, post-redaction — exporters can never see raw sensitive data) fans out to the exporters declared under telemetry.exporters in optic.yaml.
Built-in exporter types:
file append JSONL to disk, size-based rotation
webhook POST JSON batches to an HTTP endpoint
otlp emit OpenTelemetry spans to a collector (OTLP/HTTP + JSON)
command THE CUSTOM PLUGIN HOOK — spawn any executable and stream one
JSON record per line to its stdin; write plugins in any
language to ship data to Kafka, S3, a SIEM, anywhere.
Delivery model: at-most-once, deliberately. Each exporter gets its own bounded queue and worker; a slow or dead exporter drops its own records (counted per exporter) and can never block the request path or starve other exporters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher owns one worker per configured exporter.
func New ¶
func New(cfgs []config.ExporterCfg, logger *slog.Logger, m Metrics, serviceName string) (*Dispatcher, error)
New builds exporters from config and starts their workers.
func (*Dispatcher) AcceptsAppLogs ¶ added in v0.11.0
func (d *Dispatcher) AcceptsAppLogs() bool
AcceptsAppLogs reports whether any configured exporter takes log lines, so the caller can skip the work entirely when none do.
func (*Dispatcher) Enqueue ¶
func (d *Dispatcher) Enqueue(rec *store.Record)
func (*Dispatcher) EnqueueAppLog ¶ added in v0.11.0
func (d *Dispatcher) EnqueueAppLog(l *ext.AppLog)
Enqueue hands a record to every exporter without ever blocking. EnqueueAppLog fans one governed log line out to every exporter that accepts them. Exporters without app-log support simply do not receive it.
func (*Dispatcher) Shutdown ¶
func (d *Dispatcher) Shutdown()
Shutdown flushes pending batches and closes every exporter.
func (*Dispatcher) Stats ¶
func (d *Dispatcher) Stats() []Stat
Stats reports per-exporter delivery counters.
type Exporter ¶
Exporter delivers batches of governed records to one destination. The contract lives in ext so out-of-tree plugins can implement it; this is an alias, not a parallel definition.