telemetry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package telemetry records opt-in, aggregate operational metrics about destructive operations: per-op counts, success/error tallies, and total duration. It plugs into the same audit.Auditor seam as the audit log, so it adds no new interception point in the app layer.

Privacy: telemetry deliberately records ONLY the operation name, outcome, and duration — never profile names, hosts, dump IDs, actor, or any data. It is off by default and must be explicitly enabled in config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder is an audit.Auditor sink that accumulates aggregate counters and flushes them to a JSON file. Safe for concurrent use.

func NewRecorder

func NewRecorder(path string) *Recorder

NewRecorder returns a telemetry Recorder that flushes aggregates to path (created on first flush), or nil if path is empty.

func (*Recorder) Begin

func (r *Recorder) Begin(_ context.Context, ev audit.Event) audit.Handle

Begin returns a handle that, at End, increments this op's aggregate counters and flushes the snapshot. Only ev.Op and the outcome/duration are read — no identifying fields.

Jump to

Keyboard shortcuts

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