Documentation
¶
Overview ¶
Package telemetry provides the minimal metrics set for tool calls: a call counter labeled by tool and outcome, a per-tool duration histogram, and an audit-drop counter, served in Prometheus text exposition format. It is dependency-free by design; hosts that need a full metrics stack can mount their own handler instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is a concurrency-safe collector plus http.Handler. The zero value is not usable; construct with NewMetrics.
func (*Metrics) Hooks ¶
Hooks returns lifecycle hooks that record one counter increment and one duration observation per tool call. Compose with other hooks via hook.Join.
func (*Metrics) ServeHTTP ¶
func (m *Metrics) ServeHTTP(w http.ResponseWriter, _ *http.Request)
ServeHTTP writes the Prometheus text exposition format. Output is sorted so scrapes are deterministic.
func (*Metrics) SetAuditDropped ¶
SetAuditDropped installs a live reader for the audit drop counter (e.g. audit.AsyncAuditor.Dropped), sampled at scrape time.