
See what model calls consumed
Model calls can leave a consistent trace of usage, timing and outcome. Wildo supplies a structured-log destination and can forward traces to a selected observability provider.
This makes AI behavior easier to compare across features without giving every caller its own telemetry format.
Example — Explain a slow response
A team inspects the call’s duration and token usage to distinguish a large model response from an application delay.
For engineers
Enable the observability capability and select its provider in the runtime scope that makes the model calls. These excerpts adapt Wonder Todos’ configuration; they belong in three existing sections of wildo.saas.config.ts:
// In engineCapabilities:
[EngineCapability.LLM_OBSERVABILITY]: { enabled: true },
// In the runtime scope's providers:
posthog: {
engineCapabilities: [EngineCapability.LLM_OBSERVABILITY],
providerCapabilities: ['LLM_OBSERVABILITY'],
protocols: [],
},
// In the same scope's selection:
[EngineCapability.LLM_OBSERVABILITY]: {
primary: 'posthog',
whenUnavailable: [],
},
Supply the provider’s POSTHOG_PROJECT_API_KEY through runtime secret configuration and install its declared posthog-node dependency in that runtime. POSTHOG_HOST selects the provider endpoint when needed. Observability has no request/response exchange protocol here; its provider supplies a trace sink.
Author content capture and sampling in the environment’s infrastructure configuration. This illustrative fragment keeps content capture off and requests all calls; it is separate from the provider declaration and the OTLP activation switch:
observability: {
llmObservability: {
captureContent: false,
sampleRate: 1,
},
},
Configuration synchronization projects this policy into the executing process’s environment. The following shows its generated result, not a file to maintain by hand:
# WILDO_LLM_OBS_CAPTURE_CONTENT is omitted; capture defaults to false.
WILDO_LLM_OBS_SAMPLE_RATE=1
The absent capture flag keeps prompts and completions out of provider capture; 1 requests no deliberate sampling drop. Delivery still remains best effort. Local structured-log content is separately gated by AgentTraceabilityLevel.DEBUG_VERBOSE; turning on provider capture does not change that logger policy.
Understand the inherited trace
Trace sinks consume AgentCallTraceEmission. The built-in logger extracts usage, duration and outcome from that envelope. This selected implementation excerpt shows ordinary metadata and the separate verbose-content gate:
this.logger.info('agent-call-trace', {
agentRef: trace.agentRef,
outcome: trace.outcome,
...(trace.attempt ? { attempt: trace.attempt } : {}),
...(trace.context?.usage ? { usage: trace.context.usage } : {}),
...(trace.context?.executionTime != null ? { executionTimeMs: trace.context.executionTime } : {}),
...(trace.context?.finishReason ? { finishReason: trace.context.finishReason } : {}),
...(trace.error ? { error: trace.error } : {}),
...(context?.attributes ? { attributes: context.attributes } : {}),
...(verbose ? { input: trace.input, output: trace.output } : {}),
});
verbose is determined from the resolved AgentTraceabilityLevel.DEBUG_VERBOSE policy. Selecting richer trace content is a deliberate policy decision, not a prerequisite for token and latency metadata.
Add a provider when you need aggregation
The observability sink resolves the configured provider lazily. The PostHog implementation accepts sampling and a separate captureContent choice; content capture starts off. Its runtime client is an optional dependency required where that provider actually executes.
Generation and embedding records differ. Generation usage includes prompt and completion tokens; embeddings summarize input use and vector dimensions. Raw embedding vectors are excluded from analytics even when content capture is enabled.
Use telemetry for observation
Composite sinks isolate failures and flush children during shutdown. A failed analytics sink should not fail the model call it observes. Sampling and best-effort delivery mean provider records are operational signals, not a complete accounting ledger. Budgets are enforced by the separate admission mechanism, not by the existence of a telemetry event.