--- title: Exports description: Getting data out of ClawMetry — session and trace exports, CSV from the reports browser, the raw query API, OTLP push, SIEM export and the evidence pack. keywords: export agent telemetry, agent data CSV export, SIEM export agent logs, OTLP export, evidence pack eyebrow: Data & storage --- # Exports The store is yours. Several ways to get data out of it, in rough order of how often people want them. ## The query API The most flexible route, and the one to reach for first. Every shape returns JSON you can pipe. ```bash # every session in a window, as newline-delimited JSON curl -s localhost:8900/api/local/query -X POST \ -H 'content-type: application/json' \ -d '{"shape":"sessions","args":{"since":"2026-08-01T00:00:00Z","limit":2000}}' \ | jq -c '.rows[]' > sessions.ndjson # per-day cost as CSV curl -s localhost:8900/api/local/aggregates \ | jq -r '.rows[] | [.day, .total_tokens, .cost_usd] | @csv' > cost.csv ``` → [Query API](/docs/data/query-api/) ## Session and trace exports ```bash curl -s 'localhost:8900/api/export/traces' | jq curl -s 'localhost:8900/api/export/events' | jq ``` The Conversations tab also exports an individual session — its transcript, tool timeline and cost breakdown — for sharing or archiving. ## The reports browser Drop a Markdown file in `~/.clawmetry/reports/` and it becomes a page, with SQL results rendered inline and a CSV download. ```bash clawmetry reports curl -s localhost:8900/api/reports | jq curl -s localhost:8900/reports//export.csv ``` This is the right answer for a recurring question that is not worth a dashboard tab. Write the query once, and it is a page with a CSV link forever. ## Push to your observability stack Rather than pulling, push. ClawMetry can export its own metrics over OTLP: ```bash export CLAWMETRY_OTEL_EXPORT_ENDPOINT=https://otlp.example.com/v1/metrics export CLAWMETRY_OTEL_EXPORT_HEADERS='{"x-api-key":"…"}' export CLAWMETRY_OTEL_EXPORT_INTERVAL=60 ``` ```bash curl -s localhost:8900/api/otel/export | jq curl -s localhost:8900/api/otel-status | jq ``` Agent cost and activity then sit next to the rest of your infrastructure telemetry, in whatever you already use. → [OpenTelemetry](/docs/runtimes/opentelemetry/) **Tier:** `otel_export` is a Pro feature. ## SIEM export For security tooling, a stream shaped for a SIEM rather than a metrics backend. | Variable | Effect | |---|---| | `CLAWMETRY_SIEM_HOST` | Destination host | **Tier:** `siem_export` is Enterprise. ## Evidence pack A bundle assembled for regulatory review — the events, the integrity verification, the policy decisions and the attributions, packaged together. ```bash curl -s localhost:8900/api/compliance/evidence-pack | jq curl -s localhost:8900/api/compliance/status | jq curl -s localhost:8900/api/compliance/article50/preview | jq ``` **Tier:** `evidence_pack` is Enterprise. ## Copying the store itself For a full backup, copy the DuckDB file — but stop the daemon first, or you may capture an inconsistent state. ```bash clawmetry sync --restart cp ~/.clawmetry/local_store.duckdb ~/backups/clawmetry-$(date +%F).duckdb ``` You can then open it with any DuckDB client: ```bash duckdb ~/backups/clawmetry-2026-09-05.duckdb -c "SELECT count(*) FROM events" ``` :::note Exports contain your transcripts Session content includes whatever your agents read and wrote, which can include secrets that ended up in a tool result. Treat an export with the same care as the sessions themselves, and see [Hardening](/docs/config/security/) for redaction options. ::: ## Before uninstalling `clawmetry uninstall` removes the store. Export anything you want to keep first — the rollups in particular, since they hold long-term cost history that survived your retention window. ```bash curl -s localhost:8900/api/local/runtimes | jq '.rows' > runtime-history.json curl -s localhost:8900/api/local/models | jq '.rows' > model-history.json curl -s localhost:8900/api/local/aggregates | jq '.rows' > daily-history.json ```