ExAgent. Observability. ReqLLM
(ExAgent v2.0.0)
View Source
Application-owned ReqLLM tracing with one generation span per request.
Attach once during application startup, after configuring the host SDK:
:ok = ExAgent.Observability.ReqLLM.attach()This uses ReqLLM's public bridge and adapter behaviour. Inside an observed ExAgent Model request, it enriches the existing Model span with bounded request attributes and streaming timing. It does not create or end another span, overwrite execution accounting/status, or capture provider content/errors. ReqLLM's optional metrics remain available when the host supplies its meter APIs. Outside that context, all callbacks delegate to ReqLLM's stock OTel adapter.
:content and :langfuse options apply to standalone ReqLLM calls. ExAgent's
adapter always requests metadata-only telemetry; its own explicit redactor
continues to control opt-in content. SDK, exporter and handlers belong to the
application; this module does not start them or replace foreign handlers.
Replace a previous ReqLLM.OpenTelemetry.attach/2 with this attach, rather than
registering both. Observed ExAgent adapter requests reject conflicting stock
bridges before provider IO. Configure handlers at startup, not during requests.
Arbitrary third-party instrumentations are outside this ownership check.
ReqLLM's bridge tracks requests in its own ETS table. Abrupt worker termination
can leave entries without a terminal event; long-lived hosts must periodically
call prune_stale_spans/1 with their chosen TTL. Pruning does not finish spans;
ExAgent's watcher independently closes its own span. The SDK's shutdown/VM death
and the upstream tracking lifecycle retain their documented limitations.
Summary
Functions
Attach the single integrated bridge; never detach an application's foreign bridge.
Detach only the integrated handler and its upstream in-flight entries.
Prune the integrated bridge's upstream entries using the host's TTL in milliseconds.