History

Add anonymous PostHog telemetry for provider lifecycle events

- introduce `AnalyticsService` with buffered PostHog batch flush - add hashed telemetry identifier from Codex account id or anonymous local id - record provider session/turn lifecycle events and flush on stop-all - wire telemetry layer into server runtime and update tests with no-op analytics

Julius Marminge committed 8 months ago

Commit ec3778b1 parent 8c5b8d312 files · +337 −7Browse files

Showing the changes to apps/server/src/wsServer.ts (1 of 12 files). Show all

Unified · Split

apps/server/src/wsServer.ts+3−1
@@ -71,6 +71,7 @@ import { · 70 unmodified lines
71 resolveAttachmentPathById,71 resolveAttachmentPathById,
72} from "./attachmentStore.ts";72} from "./attachmentStore.ts";
73import { parseBase64DataUrl } from "./imageMime.ts";73import { parseBase64DataUrl } from "./imageMime.ts";
74import { AnalyticsService } from "./telemetry/Services/AnalyticsService.ts";
74 75
75/**76/**
76 * ServerShape - Service API for server lifecycle control.77 * ServerShape - Service API for server lifecycle control.
@@ -207,7 +208,8 @@ export type ServerRuntimeServices = · 130 unmodified lines
207 | GitCore208 | GitCore
208 | TerminalManager209 | TerminalManager
209 | Keybindings210 | Keybindings
210 | Open;211 | Open
212 | AnalyticsService;
211 213
212export class ServerLifecycleError extends Schema.TaggedErrorClass<ServerLifecycleError>()(214export class ServerLifecycleError extends Schema.TaggedErrorClass<ServerLifecycleError>()(
213 "ServerLifecycleError",215 "ServerLifecycleError",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t