ExAgent. Observability. ReqLLM. Maintenance
(ExAgent v3.0.0)
View Source
Optional application-supervised cleanup of the integrated ReqLLM bridge.
Stability — Candidate.
Attach ExAgent.Observability.ReqLLM once after the host SDK is configured,
then include this child in the application's supervision tree:
{ExAgent.Observability.ReqLLM.Maintenance,
ttl_ms: 120_000, interval_ms: 30_000}Both options are required positive integers in milliseconds. Choose a TTL longer than every allowed live ReqLLM request, including standalone calls, streaming and retries. Pruning is based on age, not process liveness. A shorter TTL can remove a live request's tracking and lose its terminal diagnostics. This child does not configure or enforce the application's request deadlines.
Each node-local worker periodically calls ReqLLM's public pruning API for the integrated handler only. It stays dormant when that handler is absent. It never attaches/detaches a bridge, starts an SDK, finishes a span or prunes another handler. Stopping the child leaves the host's tracing configuration intact. Each worker schedules its next timer after the current pass.
stats/0 exposes the default worker's numeric cleanup counters and status,
without request IDs, content or span data. Counters reset on restart.
ReqLLM scans its matching entries; its transient allocation and the overall
table size are not a hard memory bound. Request admission remains host-owned.
No child is installed automatically by ExAgent or
ExAgent.Observability.ReqLLM.attach/1.
Summary
Functions
Returns a specification to start this module under a supervisor.
Start the worker through the application's supervision tree.
Read the default worker's counters. Returns {:error, :unavailable} when it is not
running or does not reply within five seconds.
Types
@type stats() :: %{ ticks: non_neg_integer(), passes: non_neg_integer(), pruned_entries: non_neg_integer(), last_pruned_entries: non_neg_integer(), status: :waiting | :active | :detached }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Start the worker through the application's supervision tree.
Requires a positive integer :ttl_ms and an :interval_ms in 1..4_294_967_295.
The optional :name is a local registered atom and defaults to this module.
Invalid configuration raises ArgumentError before starting the worker.
@spec stats() :: stats() | {:error, :unavailable}
Read the default worker's counters. Returns {:error, :unavailable} when it is not
running or does not reply within five seconds.