-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Add Copilot 3rd-party agent metrics #4460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gmlewis
merged 1 commit into
google:master
from
Tens1des:feat/copilot-3rd-party-agent-metrics
Aug 21, 2026
+170
−1
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought these were unmarshal only types so I'm unsure why they need
omitempty?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question —
omitemptyonly affects marshaling, so it's not required for Unmarshal itself.I kept it to match the existing Copilot metrics types and the CONTRIBUTING guidance for response bodies (optional pointer fields use
omitempty), and so nil fields round-trip cleanly viatestJSONMarshal/ user re-marshaling without emittingnull.Happy to drop it if you'd prefer these tags to be unmarshal-only.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - it is common practice in this repo to use pointers and
omitemptyfor unmarshal-only types, especially when structs are used for many different endpoints. Then, when the GitHub v3 API servers do not provide fields, it is easy to see when they are not included.I think it is fine to run with this without modification.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmlewis I'm not sure I follow? The official docs for JSON struct tags say
omitempty&omitzeroare ignored during unmarshalling, and this type is unmarshal only. I also don't think the struct tag should be conflated with the use of a pointer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see exactly what you are saying, and you are right, @stevehipwell.
I think the biggest challenge in this repo is to determine which fields are unmarshal-only, so I wrote #4478 to analyze the situation.
I still like the point made by @Tens1des regarding:
So I think we should go ahead with this PR and merge as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexandear or @Not-Dhananjay-Mishra - do you have any opinions in this matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the
omitemptyin another PR.