{{ message }}
Record attachment counts in telemetry - #14327
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
PR and issue comment validation failures omit the paired command_invocation event.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
What changed in this PR
Adds attachment-count telemetry to issue and pull request create, edit, and comment commands.
Changes:
- Records
attachment_invocationevents with command path and attachment count. - Samples attachment invocations at 100%.
- Propagates telemetry recorders through command constructors and adds tests.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
babakks
self-requested a review
September 3, 2026 09:09
6 tasks
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.


Description
Command telemetry records whether
--attachwas used, but not how many times it was provided. An invocation with several attachments is therefore indistinguishable from one with a single attachment.This adds an
attachment_invocationevent to issue and pull request create, edit, and comment commands. The event includes the command path and anattach_countmeasure. Invocations using--attachare sampled at 100%, which also captures the pairedcommand_invocationevent at the same rate.The event is recorded before attachment validation. It captures the supplied flag count when a conflict, missing file, or other validation error stops the command. It does not include file paths, alt text, body content, repository information, or asset data.
How did you test this change?
I set telemetry to
login an isolated configuration and ran all six supported commands with two missing image paths. Each command stopped before upload and printed exactly oneattachment_invocationevent with the corresponding command,attach_countset to2, andsample_rateset to100.I then ran
gh versionwithout--attachand saw no attachment event.Key points
Notes for reviewers
Start with the attachment flag telemetry method. The remaining production changes pass the recorder to each command. Assertions are integrated into the existing command constructor tables.
This follows the dependency injection and domain-specific event approach established by skills-specific telemetry.
Authorship and follow-up
Who wrote this:
Who answers review comments: