READMESource: main@5175baf2
OTel Export for DSH
DSH has cost dashboards, but no machine-readable export. This turns a
dsh-token-auditJSON summary into OTLP/JSON metrics for Grafana, Langfuse, or any collector that accepts JSON.
It is a summary exporter: cost, tokens, sessions, calls, projected monthly, idle/peak, and per-model totals. It does not produce per-turn or per-tool spans.
Pipeline
dsh-token-audit --all --format json > audit.json
node bin/dsh-otel.mjs --input audit.json --output otlp.json
In DSH:
Use otel_export on audit.json, format=summary.
Metrics
dsh.cost.cnydsh.tokens.input,dsh.tokens.cache_read,dsh.tokens.outputdsh.sessions,dsh.callsdsh.cost.projected_monthly_cnydsh.cost.idle_cny,dsh.cost.peak_cny- per model:
dsh.model.cost.cny,dsh.model.calls,dsh.model.tokens.output
Boundaries
- No network: it writes JSON; your collector uploads it.
- No per-turn/per-tool spans, no live streaming, no dashboard.
- It inherits the audit's pricing; it does not re-price.
- Redact the audit before exporting if titles/paths are sensitive.
- OTLP/JSON only, not protobuf.
Tests
npm test
Provenance
Inspired by claude-code-otel; no source copied.
See NOTICE.md. License: MIT.
No comments yet. Be the first to write one.