Skip to content

feat: add install_completed + first_rule_injected telemetry with hash-based cohort assignment#16

Open
Gradata wants to merge 4 commits into
mainfrom
feat/telemetry-install-cohort
Open

feat: add install_completed + first_rule_injected telemetry with hash-based cohort assignment#16
Gradata wants to merge 4 commits into
mainfrom
feat/telemetry-install-cohort

Conversation

@Gradata
Copy link
Copy Markdown
Owner

@Gradata Gradata commented May 18, 2026

Adds lab experiment telemetry to unblock GRA-221 (install_time_to_first_rule measurement).

Changes

  • New hooks/lib/telemetry.js: generateInstallId, getCohort (hash-based 50/50 split), emitInstallCompleted, emitFirstRuleInjected
  • setup/install.js: emits install_completed on install with deterministic cohort
  • hooks/session-stop.js: emits first_rule_injected once per install when rules are active
  • Install ID persisted to ~/.gradata/install_id for cross-hook read
  • Guard file prevents duplicate first_rule_injected emissions

Verification

  • All three files pass node --check
  • Cohort assignment: hash(installId)[0] < '8' → control, else treatment
  • Telemetry calls are best-effort (non-blocking, never throw)

Unblocks: GRA-221 (measurement window can open once this ships)

growth-eng and others added 4 commits May 12, 2026 13:32
…-based cohort assignment

- New hooks/lib/telemetry.js: generateInstallId, getCohort (hash-based 50/50 split), emitInstallCompleted, emitFirstRuleInjected
- setup/install.js: emits install_completed on install with deterministic cohort
- hooks/session-stop.js: emits first_rule_injected once per install when rules are active
- Install ID persisted to ~/.gradata/install_id for cross-hook read
- Guard file prevents duplicate first_rule_injected emissions
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dee2bab0-0b70-4b66-8ee7-463778646579

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/telemetry-install-cohort

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant