feat(observability): record every run to an OTLP collector by default - #310
Merged
Conversation
Add a RunRecorder protocol with a process default, an OtlpRecorder that shapes a finished run into a Langfuse-ready trace, and AgentRunner hand-off on every terminal state. The recorder installs itself from AGENT_TELEMETRY_* when the kit is imported, so a deployment turns tracing on by setting an endpoint. Export is queued and fails open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RunRecorderprotocol intesserix_adk.corewith a process-wide default (install_default_recorder,default_recorder) andbound_sessionfor grouping runs.AgentRunnerhands every run that reaches a terminal state to its recorder. Recorder failures are counted onrecording_failures, never raised.tesserix_adk.observability.otlp:OtlpSettings.from_envreadsAGENT_TELEMETRY_*;build_spansturns a run into one Langfuse-shaped trace (agent root, generation/tool children, flagged events) with ids derived from the run id;OtlpRecorderqueues spans behind a batch processor;install_from_envruns at import so any deployment that setsAGENT_TELEMETRY_ENDPOINTrecords without wiring.otlpextra (opentelemetry-sdk, opentelemetry-exporter-otlp-proto-http), included inall. Base install is unchanged.Why
Every product was about to carry its own copy of the telemetry module. Putting it in the kit means one convention, one env contract, and traces from every agent by default.
Checks
make checkis green apart fromdocs-check, which fails on a pre-existing untracked local ADR file that is not part of this change. Admission records, dependency floors and typing-policy entries added for the new extra.