Commit graph

3 commits

Author SHA1 Message Date
Garm
d4cd49af95 feat(telemetry): add headroom_stack and install_mode identity fields
Adds two orthogonal identity fields to the anonymous telemetry beacon so we
can segment usage by integration surface and deployment shape:

- headroom_stack: how Headroom is invoked (proxy, wrap_claude, wrap_codex,
  adapter_ts_openai, adapter_ts_anthropic, etc.). Resolved from HEADROOM_STACK
  env, HEADROOM_AGENT_TYPE fallback, or aggregated request-header counts.
- install_mode: how the proxy is deployed (wrapped / persistent / on_demand).
  Detected from HEADROOM_AGENT_TYPE plus DeploymentManifest lookup.

TS SDK adapters now tag every request with X-Headroom-Stack; a FastAPI
middleware buckets the counts and surfaces them via /stats so the beacon can
report requests_by_stack for mixed-integration sessions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 17:12:38 +02:00
chopratejas
14d00c6c74 Token-level cache hit rate, compression-vs-cache tracking, dashboard SQL, security plan
Cache stats:
- hit_rate is now token-level (cache_read / total_input) not request-level
- Track uncached_input_tokens per provider in metrics
- Preserve request_hit_rate as secondary metric

Compression-vs-cache:
- Detect when compression busts the prefix cache (expected_cached - actual_read)
- Two simple session-level numbers: tokens_saved vs cache_bust_tokens
- Log CACHE-BUST per request, aggregate in /stats and telemetry beacon
- Single new column in proxy_telemetry_v2: cache_bust_tokens

Dashboard infra:
- SQL for dashboard_summary table + pg_cron hourly refresh
- Hourly + daily aggregation from proxy_telemetry_v2
- Upgrade scripts for adding hourly_stats and cache bust columns
2026-04-06 18:10:29 -07:00
chopratejas
c6d6c6a96c Switch telemetry to proxy_telemetry_v2 table, bump to 0.5.12
Telemetry beacon now writes to proxy_telemetry_v2 which has all 25
columns matching the beacon payload. Added SQL schema for the new table.
2026-03-30 10:55:45 -07:00