Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion acceptance/testdata/skills/skills-install.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ grep 'github-repo' $WORK/custom-skills/git-commit/SKILL.md

# Telemetry: skill_install event records agent hosts, repo identifiers,
# and (for a public repo) the installed skill name.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
exec gh skill install github/awesome-copilot git-commit --scope user --force --agent github-copilot
Expand Down
1 change: 0 additions & 1 deletion acceptance/testdata/skills/skills-preview.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ stderr 'not found'

# Telemetry: skill_preview event records repo identifiers and, for a
# public repo, the skill name.
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
Comment thread
williammartin marked this conversation as resolved.
exec gh skill preview github/awesome-copilot git-commit
Expand Down
1 change: 0 additions & 1 deletion acceptance/testdata/telemetry/command-invocation.txtar
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Telemetry log mode outputs command invocation event to stderr
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# resolved inner command should still record normally β€” its path is a core
# gh command and conveys no user-authored identifier.

env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# The completion command should not generate a telemetry event
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# organization or project name).
[!exec:bash] skip

env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GHES users should not get telemetry even when telemetry is enabled
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_ENTERPRISE_TOKEN=fake-enterprise-token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# The send-telemetry command should not itself generate a telemetry event
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_TELEMETRY_ENDPOINT_URL=http://localhost:1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Command completes successfully even when telemetry endpoint is unreachable
env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=enabled
env GH_TELEMETRY_SAMPLE_RATE=100
env GH_TELEMETRY_ENDPOINT_URL=http://localhost:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# names come from a fixed, hard-coded registry and do not contain any
# user-authored identifiers.

env GH_PRIVATE_ENABLE_TELEMETRY=1
env GH_TELEMETRY=log
env GH_TELEMETRY_SAMPLE_RATE=100

Expand Down
2 changes: 1 addition & 1 deletion internal/ghcmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Main() exitCode {
telemetryService = &telemetry.NoOpService{}
default:
telemetryState := telemetry.ParseTelemetryState(cfg.Telemetry().Value)
telemetryDisabled := os.Getenv("GH_PRIVATE_ENABLE_TELEMETRY") == "" || mightBeGHESUser(cfg)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi, I have a minor code review nit: What the hell is this?

There isn't even an opt-out. Please add a note to the changelog saying "we scrape your data unconditionally now" so users can make an informed decision.

Copy link
Copy Markdown

@RickyNotaro RickyNotaro Apr 24, 2026

Choose a reason for hiding this comment

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

If you could understand the code you are reading, you would realise that the telemetryState variable is fed from ParseTelemetryState()

func ParseTelemetryState(configValue string) TelemetryState {
and that is the user can opt out as stated in the documentation with the GH_TELEMETRY, the DO_NOT_TRACK environnement variable or event with the gh config set telemetry disabled CLI config.

These configs will make the functions return Disabled for the telemetryState variable and &telemetry.NoOpService{} (a dummy, empty, or placeholder service) will be used.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's not scraping.

telemetryDisabled := mightBeGHESUser(cfg)

switch telemetryState {
case telemetry.Disabled:
Expand Down
Loading