Runtimes
OpenTelemetry ingest#
ClawMetry can observe the AI application you build: a chatbot, predictive assistant, recommendation service or custom agent. Send request traces from a standard OpenTelemetry SDK or through HTTP. Your application does not need to use a named agent runtime.
Use the existing Tracing view to inspect operation timing, parent-child
relationships and reported errors. Set resource service.name to identify your
application. Generic predictions need no chat labels or token counts. Model
and token metadata add AI-specific accounting where the exporter supplies them.
Python and Java use their standard OTel SDKs. You can also send OTLP/JSON from another language. Runnable Python, Java and HTTP starters execute a local classifier without a model key. They demonstrate integration, not model quality or a provider inference call. Read the full application integration guide.
Deploy a receiver on your machine or private network. The hosted dashboard URL is not a public plaintext collector. Hosted viewing uses the existing daemon sync and client-side decryption path, and must be verified for the deployed node. Incoming traces alone do not enable pause, stop or pre-tool controls.
Your application workspace#
Each observed service appears under Your applications in the dropdown. Select it for its request traces and Agent Inventory. The first integration exposes these focused views; native runtime navigation returns when you switch back.
Inside a trace, model calls, tools, tokens and cost appear when supplied. Missing usage is not reported as free inference. Generic spans do not unlock filesystem memory, skills, runtime setup, approvals or process controls. Conversation IDs group stored sessions; they do not supply a full chat transcript by themselves. Hosted tracing labels its bounded recent sync window.
Receiving#
Three HTTP endpoints on the dashboard:
| Endpoint | Payload |
|---|---|
POST /v1/traces | Spans — the agent's structure, tool calls, latencies |
POST /v1/metrics | Counters and gauges — tokens, cost, run counts |
POST /v1/logs | Log records — including cost-bearing events from runtimes that report cost as a log |
Point any OTLP/HTTP exporter at http://localhost:8900:
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:8900
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobufInstall the optional protobuf dependency to accept binary OTLP:
pip install 'clawmetry[otel]'Authentication#
Loopback needs no credential. For a server application on another machine, create a scoped ingest key on your receiver and use TLS:
clawmetry key create --name support-app --scope write:ingest --origin none
export OTEL_EXPORTER_OTLP_ENDPOINT=https://clawmetry.internal
export OTEL_EXPORTER_OTLP_HEADERS='x-clawmetry-key=YOUR_INGEST_KEY'This key can push telemetry and cannot read traces. Keep it in the server's secret configuration, never a browser. A browser chatbot exports from its backend.
Set CLAWMETRY_OTLP_CONTENT=metadata on the receiver to withhold message and tool
content. The default redacted profile may retain content after filtering; no
filter removes every kind of personal information. The starter applications send
no message bodies.
HTTP/protobuf is supported by standard Python and Java exporters. JSON intake
works on the base receiver, but SDK support for http/json varies. A gRPC-only
exporter needs a Collector that exports otlphttp to ClawMetry.
Limits#
| Variable | Default | Purpose |
|---|---|---|
CLAWMETRY_OTLP_MAX_DECOMPRESSED_MB | 64 | Reject payloads that expand beyond this. Guards against decompression bombs. |
CLAWMETRY_OTLP_APP_CAP | 50 | Maximum custom applications shown in the runtime summary. This does not cap stored applications. |
CLAWMETRY_MAX_REQUEST_MB | — | Global request size cap. |
Claude Code's native OTel#
Claude Code emits OpenTelemetry natively, and ClawMetry consumes it alongside the JSONL transcripts. Two things are worth knowing if you wire it up:
- Cost arrives on both a log record and a metric. ClawMetry counts it once.
If you build your own pipeline on the same feed, do not sum both.
- Session ids appear bare on the wire, not namespaced with a runtime
prefix, so anything joining OTel spans to sessions has to know that.
Spans map onto ClawMetry's model directly: an assistant turn becomes an
llm.call, each tool_use a tool.<name> child, a Task an agent.spawn,
and a thinking block an internal thinking span. That mapping is what the
Agent Graph and turn-anatomy views are built on.
Querying what arrived#
# traces, one row per trace_id with aggregate span stats
curl -s 'http://localhost:8900/api/local/traces?limit=20' | jq '.rows'
# spans, filtered
curl -s 'http://localhost:8900/api/local/spans?session_id=<sid>&limit=200' | jq '.rows'
# a single span
curl -s 'http://localhost:8900/api/local/spans/<span_id>' | jqThe Tracing tab renders the same data as a waterfall.
Exporting out#
ClawMetry can push its own trace spans to your collector, so agent cost and activity land next to the rest of your infrastructure telemetry.
| Variable | Purpose |
|---|---|
CLAWMETRY_OTEL_EXPORT_ENDPOINT | OTLP/HTTP trace endpoint, including /v1/traces. Setting it starts the exporter. |
CLAWMETRY_OTEL_EXPORT_HEADERS | JSON object of headers, for auth against your collector |
CLAWMETRY_OTEL_EXPORT_INTERVAL | Export cadence in seconds |
export CLAWMETRY_OTEL_EXPORT_ENDPOINT=https://otlp.example.com/v1/traces
export CLAWMETRY_OTEL_EXPORT_HEADERS='{"x-api-key":"…"}'
export CLAWMETRY_OTEL_EXPORT_INTERVAL=60Status and a manual trigger:
curl -s localhost:8900/api/otel-status | jq
curl -s localhost:8900/api/otel/export | jqTier: the export path is otel_export, a Pro feature. Ingestion is not
gated.
Which path should you use?#
| You have | Use |
|---|---|
| A framework with OTel support | This page — point the exporter at ClawMetry |
| Python code you can edit | The interceptor — two lines, gets cost |
| Structured runs to push | The ingest API — explicit run and event shape |
| A runtime that writes to disk | Ask for an adapter — it is the highest-fidelity path |