# `AgentDb.Observability.Sink`
[🔗](https://github.com/manhvu/agent_db/blob/v0.1.0/lib/agent_db/observability/sink.ex#L1)

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.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `max_errors`

```elixir
@spec max_errors() :: pos_integer()
```

Maximum number of recent failures retained.

# `max_latency_samples`

```elixir
@spec max_latency_samples() :: pos_integer()
```

Maximum number of duration samples retained per tracked operation.

# `max_tracked_operations`

```elixir
@spec max_tracked_operations() :: pos_integer()
```

Maximum number of distinct operations tracked.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
