Skip to content

Telemetry

The Telemetry primitive defines how agent behavior is observed, measured, and exported for analysis. It is OPTIONAL at all conformance levels and MUST NOT affect core agent functionality — an agent without Telemetry configured MUST behave identically to one with it.

URI pattern: claw://local/telemetry/{name}


claw: "0.3.0"
kind: Telemetry
metadata:
name: "observability"
version: "1.0.0"
spec:
exporters:
- type: "otlp"
endpoint: "https://otel-collector.internal:4318/v1/traces"
auth:
secret_ref: "OTEL_API_KEY"
batch:
max_size: 1000
flush_interval_ms: 5000
- type: "file"
path: "/var/log/agent/telemetry.jsonl"
events:
tool_calls: true
memory_ops: false
world_model_ops: false
planning_ops: false
swarm_ops: false
lifecycle: true
errors: true
metrics:
token_usage: true
cost_usd: false
latency_histogram: true
prediction_error: false
retrieval_hit_rate: false
plan_revision_count: false
sampling:
rate: 1.0 # 0.0 = off, 1.0 = all events
redaction:
strip_arguments: false
strip_results: false

FieldRequiredDescription
exportersYesAt least one exporter destination.
eventsNoWhich event categories to emit.
metricsNoWhich metrics to collect.
samplingNoSampling rate (0.0 to 1.0).
redactionNoData redaction settings for tool arguments and results.

TypeBackendRequired FieldsUse Case
otlpOpenTelemetry CollectorendpointProduction — Datadog, Jaeger, Grafana Tempo
fileJSONL log filepathOffline environments, local debugging
sqliteSQLite databasepathEmbedded devices, queryable local storage
webhookHTTP POST endpointendpointCustom integrations, alerting systems
consolestdout/stderrDevelopment, CI pipelines

CategoryDescriptionDefault
tool_callsTool invocation details (name, duration, status, error code)true
memory_opsMemory store/query/compact operationsfalse
world_model_opsPredictive model activity (predict, simulate, update)false
planning_opsPlan generation, revision, or conservative fallback decisionsfalse
swarm_opsSwarm delegate/discover/report operationsfalse
lifecycleState machine transitions (INIT, READY, etc.)true
errorsAll error responsestrue

MetricDescriptionDefault
token_usageInput/output token counts per provider calltrue
cost_usdEstimated cost per operation in USDfalse
latency_histogramLatency histograms for tool calls and provider requeststrue
prediction_errorDivergence between predicted and observed outcomesfalse
retrieval_hit_rateHow often memory retrieval materially helps executionfalse
plan_revision_countNumber of planning passes before final actionfalse

  • The exporters array MUST contain at least one entry.
  • For otlp or webhook exporters, the endpoint field is REQUIRED.
  • For file or sqlite exporters, the path field is REQUIRED.
  • The sampling.rate field MUST be a number in the range 0.0 to 1.0 inclusive. Values outside this range MUST be rejected.
  • The runtime MUST NEVER emit raw prompts, Chain-of-Thought (CoT) content, or provider response bodies in telemetry events, regardless of redaction settings. This is a security invariant.
  • When redaction.strip_arguments is true, tool call arguments MUST be replaced with a placeholder (e.g., [REDACTED]) in emitted events.

The Telemetry primitive satisfies Design Principle P7 (Auditable) by providing declarative, structured observability without code changes in the agent. It supports five exporter types covering production, offline, integration, and development scenarios. Telemetry is intentionally OPTIONAL at all conformance levels — observability should enhance, never gate, agent deployment. In CKP 0.3.0, Telemetry can also track planning and prediction quality for runtimes that implement WorldModel-driven behavior. No JSON-RPC methods are defined for Telemetry because it is emit-only: the agent produces events unidirectionally to configured exporters.