mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
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>
This commit is contained in:
parent
4651f96c92
commit
d4cd49af95
14 changed files with 306 additions and 6 deletions
|
|
@ -15,6 +15,9 @@ CREATE TABLE IF NOT EXISTS proxy_telemetry_v2 (
|
|||
sdk text,
|
||||
backend text,
|
||||
session_minutes integer,
|
||||
headroom_stack text,
|
||||
install_mode text,
|
||||
requests_by_stack jsonb,
|
||||
|
||||
-- Effectiveness metrics
|
||||
tokens_saved bigint,
|
||||
|
|
|
|||
15
sql/upgrade_telemetry_stack_context.sql
Normal file
15
sql/upgrade_telemetry_stack_context.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- Add deployment-context columns to proxy_telemetry_v2
|
||||
-- Run in Supabase SQL Editor.
|
||||
--
|
||||
-- headroom_stack: how Headroom is being invoked — e.g. "proxy",
|
||||
-- "wrap_claude", "adapter_ts_openai", "mixed", "unknown".
|
||||
-- install_mode: how the proxy process is deployed — one of
|
||||
-- "wrapped", "persistent", "on_demand", "unknown".
|
||||
-- requests_by_stack: JSONB dict {stack_slug: count} for sessions that see
|
||||
-- multiple integration surfaces (e.g. a persistent proxy
|
||||
-- serving both wrap_claude and TS adapter callers).
|
||||
|
||||
ALTER TABLE proxy_telemetry_v2
|
||||
ADD COLUMN IF NOT EXISTS headroom_stack text,
|
||||
ADD COLUMN IF NOT EXISTS install_mode text,
|
||||
ADD COLUMN IF NOT EXISTS requests_by_stack jsonb;
|
||||
Loading…
Add table
Add a link
Reference in a new issue