Skip to content

Unhook common dimensions from skill telemetry events#13364

Open
williammartin wants to merge 2 commits into
trunkfrom
wm-unhook-skills-telem
Open

Unhook common dimensions from skill telemetry events#13364
williammartin wants to merge 2 commits into
trunkfrom
wm-unhook-skills-telem

Conversation

@williammartin
Copy link
Copy Markdown
Member

@williammartin williammartin commented May 7, 2026

Description

Fixes https://github.com/github/cli/issues/1159

Skill telemetry events (skill_install, skill_preview, skill_search_install, skill_upstream_redirect) were including common dimensions (device_id, invocation_id, os, architecture, version, etc.) that we've decided are no longer necessary for skills analytics. Since they aren't necessary, better to be privacy conscious and unhook them.

Reviewer Notes

This adds a functional options pattern to Record() so callers must explicitly opt in to common dimensions via IncludeCommonDimensions(). Events recorded without this option only get their own dimensions plus timestamp and sample rate. Skill command code is unchanged - they call Record(event) without options, which now correctly excludes common dimensions.

I've considered removing common dimensions altogether and requiring them to be passed when command_invocation events are recorded but I'd like to see how future telemetry plays out before unwinding and maybe rewinding that.

@williammartin williammartin force-pushed the wm-unhook-skills-telem branch 3 times, most recently from c9c1e67 to 980e098 Compare May 7, 2026 18:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@williammartin williammartin force-pushed the wm-unhook-skills-telem branch from 980e098 to 66dc276 Compare May 7, 2026 18:08
@williammartin williammartin marked this pull request as ready for review May 7, 2026 18:15
@williammartin williammartin requested a review from a team as a code owner May 7, 2026 18:15
Copilot AI review requested due to automatic review settings May 7, 2026 18:15
@williammartin williammartin requested a review from a team as a code owner May 7, 2026 18:15
@williammartin williammartin requested a review from babakks May 7, 2026 18:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the telemetry recording API so callers must explicitly opt in to attaching “common dimensions” (device_id, invocation_id, os, architecture, version, etc.), with the goal of excluding these dimensions from skill telemetry events for improved privacy.

Changes:

  • Introduces a functional-options pattern for EventRecorder.Record(...), adding IncludeCommonDimensions() as an explicit opt-in.
  • Updates command invocation telemetry to opt in to common dimensions; skill events remain unchanged and therefore no longer receive common dimensions.
  • Updates telemetry fakes and tests to validate the new opt-in/opt-out behavior and to ensure sample_rate/timestamp behavior is preserved.
Show a summary per file
File Description
pkg/cmdutil/telemetry.go Opts command_invocation into common dimensions via IncludeCommonDimensions().
pkg/cmdutil/telemetry_test.go Asserts command_invocation explicitly includes common dimensions.
pkg/cmd/skills/search/search_test.go Asserts skill telemetry does not opt into common dimensions.
pkg/cmd/skills/preview/preview_test.go Asserts skill telemetry does not opt into common dimensions.
pkg/cmd/skills/install/install_test.go Asserts skill telemetry does not opt into common dimensions.
internal/telemetry/telemetry.go Implements per-event opt-in for common dimensions and moves sample_rate onto each event payload.
internal/telemetry/telemetry_test.go Updates tests for opt-in behavior and adds coverage for default exclusion of common dimensions.
internal/telemetry/fake.go Extends spies to capture per-Record call options for assertions.
internal/gh/ghtelemetry/telemetry.go Adds RecordOption/RecordOptions and updates the EventRecorder interface signature.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 9/9 changed files
  • Comments generated: 2

Comment thread internal/telemetry/telemetry.go
Comment thread internal/gh/ghtelemetry/telemetry.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@williammartin
Copy link
Copy Markdown
Member Author

@babakks feel free to take ownership of getting this PR in, if there are changes you want, I empower you to just make them.

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.

2 participants