feat: route telemetry directly to Azure Application Insights
Merged
KU
7mo ago+136+136+012345678901234567890123456789-124-124-012345678901234567890123456789
Summary
- Telemetry: Migrates from posting batches to
altimate-backend /api/observability/ingestto posting directly to Azure Application Insights (/v2/track), eliminating backend dependency and auth complexity - ID module: Replaces hand-rolled timestamp+base62 generator with the
ulidnpm package, usingmonotonicFactory()to preserve same-millisecond ordering guarantees
Code Review Fixes (8-model review)
id.ts: UsemonotonicFactory()instead of plainulid()— fixes non-deterministic ordering of IDs generated within the same millisecondid.ts:timestamp()now throws a clear error on descending IDs instead of a crypticDEC_TIME_MALFORMEDlibrary errortelemetry/index.ts:clearTimeoutmoved tofinallyblock to prevent timer leaktelemetry/index.ts: Loglog.debugon non-2xx HTTP responses for debuggabilitytelemetry/index.ts: UseJSON.stringifyfor object values instead ofString(v)to prevent[object Object]incustomDimensionsconfig.ts: Addtelemetry.disabledconfig field — opt-out via~/.config/altimate-code/config.json("telemetry": { "disabled": true })
Test Plan
- Built binary and ran
altimate-code run "say hello in one sentence" - Queried Azure App Insights
customEvents—session_start,generation,session_endall landed with correctcustomDimensionsandcustomMeasurements - Verified
session_Idstandard column populated correctly fromai.session.idtag