Skip to content

Track Copilot token usage in pull request dashboard#15

Open
trask wants to merge 1 commit into
open-telemetry:mainfrom
trask:copilot-token-usage-dashboard
Open

Track Copilot token usage in pull request dashboard#15
trask wants to merge 1 commit into
open-telemetry:mainfrom
trask:copilot-token-usage-dashboard

Conversation

@trask

@trask trask commented Jun 25, 2026

Copy link
Copy Markdown
Member

Track Copilot CLI token usage for pull request dashboard thread classification. The dashboard now parses usage metadata from Copilot JSON output, excludes usage from cached classifications to avoid double-counting, and logs current-run token totals during dashboard updates.

@trask trask requested a review from Copilot June 25, 2026 20:33
@trask trask marked this pull request as ready for review June 25, 2026 20:33
@trask trask requested a review from a team as a code owner June 25, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comment on lines +97 to +101
input_tokens = _numeric_usage_value(
usage.get("input_tokens")
or usage.get("prompt_tokens")
or usage.get("promptTokens")
or usage.get("inputTokens")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just out of curiosity: why is there no canonical name for this?

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.

4 participants