feat: route telemetry directly to Azure Application Insights#37
Merged
feat: route telemetry directly to Azure Application Insights#37
Conversation
Replace altimate-backend ingest with direct App Insights ingestion. Instrumentation key is baked in so all npm installs report automatically with no user configuration. `APPLICATIONINSIGHTS_CONNECTION_STRING` env var overrides the default for dev/testing. Events are mapped to App Insights custom event format: - `customDimensions` — string fields (model_id, provider_id, etc.) - `customMeasurements` — numeric fields (cost, duration_ms, token counts) - `tokens.*` payload is flattened to `tokens_input`, `tokens_output`, etc. - `ai.user.id` tag captures the authenticated user's email
anandgupta42
pushed a commit
that referenced
this pull request
Mar 17, 2026
feat: route telemetry directly to Azure Application Insights
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
altimate-backend /api/observability/ingestto posting directly to Azure Application Insights (/v2/track), eliminating backend dependency and auth complexityulidnpm package, usingmonotonicFactory()to preserve same-millisecond ordering guaranteesCode 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
altimate-code run "say hello in one sentence"customEvents—session_start,generation,session_endall landed with correctcustomDimensionsandcustomMeasurementssession_Idstandard column populated correctly fromai.session.idtag