AgentDb.Observability.Sink (agent_db v0.1.0)

Copy Markdown View Source

Holds the store's recent failures and outcome counts, so an operator can see what has been going wrong without tailing a log.

The store's telemetry events were already fire-and-forget: emitted, then forgotten, with nothing left in the process that could read them back. This is the one thing that keeps them, and it keeps them as bounded counts plus a bounded ring -- never a growing history, and never anything the measurements were not already allowed to carry.

It is a process for exactly one reason: ETS needs an owner, and the owner has to be somewhere the rest of the store already supervises. The table is public and only this module writes to it, so the :telemetry handler runs in the emitting process and a console reading it never queues behind a worker.

Summary

Functions

Returns a specification to start this module under a supervisor.

Maximum number of recent failures retained.

Maximum number of duration samples retained per tracked operation.

Maximum number of distinct operations tracked.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

max_errors()

@spec max_errors() :: pos_integer()

Maximum number of recent failures retained.

max_latency_samples()

@spec max_latency_samples() :: pos_integer()

Maximum number of duration samples retained per tracked operation.

max_tracked_operations()

@spec max_tracked_operations() :: pos_integer()

Maximum number of distinct operations tracked.

start_link(opts \\ [])