feat(app): emit task lifecycle telemetry events to Den (Analytics Layer 2)#2150
Open
benjaminshafii wants to merge 1 commit into
Open
feat(app): emit task lifecycle telemetry events to Den (Analytics Layer 2)#2150benjaminshafii wants to merge 1 commit into
benjaminshafii wants to merge 1 commit into
Conversation
Layer 2 of OpenWork Analytics from the desktop/web app: - den-telemetry events now carry source, sessionId, durationMs, success - task.started on send (alongside the existing session.active, which now carries the session id so the server can count distinct sessions) - task.completed / task.failed with duration on session idle/error, piggybacking the already-instrumented markTaskRunStart bookkeeping Auth-gated and fire-and-forget as before; only opaque ids, durations, and success flags are sent -- never prompts, code, or file paths.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Third PR of the OpenWork Analytics stack (with #2148 server and #2149 dashboard). The desktop/web app now emits real Layer 2 usage signals to
POST /v1/telemetry/ingest:apps/app/src/app/lib/den-telemetry.ts: events carrysource: "app", optionalsessionId,durationMs,success; new helperstrackTaskStarted/Completed/Failedsession-route.tsx):task.startedon each send;session.activenow carries the session id so the server can count distinct sessions per weeksession-sync.ts):task.completed/task.failedwith run duration onsession.idle/session.error, reusing the existingmarkTaskRunStart/takeTaskRunStartbookkeeping (so it only fires for runs this client instrumented, deduped across workspace syncs)Privacy unchanged: auth-gated (no-op when signed out of Den), fire-and-forget, batched; only event names, opaque session ids, durations, and success flags — never prompts, code, or file paths.
Compatibility: safe to merge independently of #2148 — the current server's zod ingest schema strips unknown fields, so older servers simply ignore the new fields; with #2148 deployed they're stored and aggregated.
Tests
Commands run:
pnpm typecheck(@openwork/app) — passesbun testinapps/app— 109 pass / 4 fail; the 4 failures (artifact-spreadsheet,artifacts) are pre-existing on the base commit (verified by running the same tests on an untouchedorigin/devworktree — same failures)task.started/task.completed/task.failedwithsessionId/durationMs/success) was verified end-to-end against the new server in feat(den): analytics event model + /v1/telemetry/analytics endpoint (Layer 1+2) #2148: ingested viaPOST /v1/telemetry/ingest(204), stored, and correctly aggregated byGET /v1/telemetry/analytics(distinct sessions, success rates, avg duration)No video for this PR: the change is invisible in the UI (background telemetry). To reproduce manually: run the local Den stack (
pnpm dev:den) with #2148, sign in to Den in the app, send a prompt, and watch rows appear intelemetry_eventand the numbers move on the #2149 Analytics page.