Skip to content

Observability

Talon integrates with Langfuse for production observability. Every agent run, sub-agent invocation, MCP tool call, and context rotation is traced and exportable.

  1. Create a Langfuse account (cloud or self-hosted)
  2. Create a project and copy the public/secret key pair
  3. Add the keys to your environment:
.env
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
  1. Enable in talond.yaml:
langfuse:
enabled: true
publicKey: ${LANGFUSE_PUBLIC_KEY}
secretKey: ${LANGFUSE_SECRET_KEY}
FieldTypeDefaultDescription
enabledbooleanfalseEnable tracing
publicKeystring—Langfuse public key (required when enabled)
secretKeystring—Langfuse secret key (required when enabled)
baseUrlstringhttps://cloud.langfuse.comLangfuse instance URL (for self-hosted)
environmentstringproductionEnvironment tag on all traces
releasestring—Version tag
ownerstring—Owner tag
exportModebatched | immediatebatchedbatched buffers events for efficiency; immediate flushes on every event
flushAtinteger20Batch size before auto-flush
flushIntervalSecondsinteger5Max seconds between flushes

Each trace corresponds to one agent run (one queue item processed). Within a trace, Langfuse shows:

SpanDescription
Agent runTop-level trace — persona, thread, provider, model, duration
GenerationEach LLM call with input/output tokens, cost, model ID
Tool callEach tool invocation — host tools, MCP tools, sub-agents
Context assemblySystem prompt construction including memory retrieval
Sub-agentNested traces for sub-agent invocations (session-summarizer, memory-groomer, etc.)
Context rotationSession rotation events with before/after token counts

Token usage (input, output, cache read, cache write) and cost are attached to each generation span.

Filter traces by persona name to see which agents cost the most. Compare input vs. cache-read tokens to gauge prompt cache efficiency.

Look for context rotation spans. If they fire too often, increase thresholdRatio. If they never fire, your conversations might be short enough that rotation isn’t needed.

Sub-agent invocations appear as nested traces. If session-summarizer or memory-groomer runs are expensive, consider adjusting their scheduling or switching them to a cheaper model.

Each span shows wall-clock duration. Use this to identify whether latency comes from the LLM call, tool execution, or context assembly.

For air-gapped or on-premises deployments, point baseUrl to your Langfuse instance:

langfuse:
enabled: true
publicKey: ${LANGFUSE_PUBLIC_KEY}
secretKey: ${LANGFUSE_SECRET_KEY}
baseUrl: https://langfuse.internal.example.com