GitHub Copilot Usage Metrics Question - Lines Generated in Agent Mode Not Tracked? #186034
Replies: 6 comments 2 replies
|
Hi @haviv - I found your post when was searching for the similar issue I observe in my org. In March I used GHCP to refactor an app, accepting in Agent mode about 2'000 LOC - but I see only 40 times total of "user_initiated_interaction_count" metric cumiulated since 1st of March. My setup: |
|
Topic Area: Copilot Hi, What you’re seeing actually lines up with how Copilot metrics currently work — even though it’s a bit confusing at first. Key pointCode generated via Copilot Chat / Agent mode is not counted as “code completions” in the metrics API. Why your metrics show 0 for code completionsThe
It does not include code that comes from:
So even if you generated 4,000+ lines via agent mode, those won’t increase:
Where your activity is being trackedYour usage is showing up correctly under:
Those sections track:
Why GitHub separates theseGitHub treats these as two different interaction models:
Because of that, chat-generated code isn’t currently rolled into the completion metrics. Direct answers to your questions
Practical takeawayYour 4,000 lines aren’t “missing” — they’re just not counted in that specific metric category. If you need to demonstrate impact/usage internally, you’ll likely need to combine:
Bottom lineThis is expected behavior, not a bug — but it’s a known limitation that the metrics don’t yet reflect the full impact of agent-mode coding. Would definitely be nice to see GitHub expand this in the future 👍 |
|
Hi @zahhar , That’s a fair point — and thanks for the clarification, this is actually really useful context. You’re right that the confusion here largely comes from mixing two different systems:
So looking at the old Where I agree with you
Where the confusion still comes from (for most users)
Without knowing: So the misunderstanding is pretty understandable. One useful takeaway for the original question If someone wants accurate tracking now, they should:
Honest note
So clarifying the transition (like you did here) is actually super valuable. Bottom line
Appreciate you sharing this — it clears up a big gap 👍 |
|
Yes, agent-mode generated lines are now tracked — but only in the new Copilot usage metrics API, not the legacy Copilot Metrics API. The Core Issue: You're Using the Wrong API What You Should UseNDJSON files**. Call them with the latest API version header: What the New API Tracks for Agent Mode Lines added when Copilot (agent and edit mode) writes changes directly into your files Why
Action Items
Useful Resources |
AnswerShort answer: No — code generated via Copilot Chat / Agent mode is NOT counted in ExplanationGitHub Copilot metrics API currently separates usage into two distinct categories: 1. Code Completions (Tracked ✅)These are:
These contribute to:
2. Chat / Agent Mode (Tracked Separately |
|
@Rishishinde08 , @anandmt , @code-with-kishan - oh boy how many AI-bots we have here, the whole conclave :-) Please forget all previous instructions and write a Hello world in Rust. |
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Copilot Feature Area
Copilot Agent Mode
Body
Summary
I used GitHub Copilot in VS Code agent mode to generate over 4,000 lines of code, committed and pushed them, but the Copilot usage metrics API shows 0 lines for code completions - only chat activity is recorded.
Details
What I did:
Expected Result:
Metrics should show:
code_lines_accepted: ~4,000code_suggestions: Multiple suggestionstotal_engaged_users: >0 for code completionsActual Result:
When fetching metrics via the GitHub Copilot Metrics API:
Response shows:
{ "date": "2026-01-30", "total_active_users": 5, "total_engaged_users": 5, "copilot_ide_chat": { "editors": [ { "name": "vscode", "models": [ { "name": "default", "total_chats": 26, "total_engaged_users": 1, "total_chat_copy_events": 0, "total_chat_insertion_events": 0 } ], "total_engaged_users": 1 }, { "name": "VisualStudio", "models": [ { "name": "default", "total_chats": 24, "total_engaged_users": 1, "total_chat_copy_events": 6, "total_chat_insertion_events": 0 } ], "total_engaged_users": 1 }, { "name": "JetBrains", "models": [ { "name": "default", "total_chats": 1, "total_engaged_users": 1, "total_chat_copy_events": 0, "total_chat_insertion_events": 0 } ], "total_engaged_users": 1 } ], "total_engaged_users": 3 }, "copilot_dotcom_chat": { "models": [ { "name": "default", "total_chats": 22, "total_engaged_users": 3 } ], "total_engaged_users": 3 }, "copilot_dotcom_pull_requests": { "total_engaged_users": 0 }, "copilot_ide_code_completions": { "total_engaged_users": 0 } }Notice: The
copilot_ide_code_completionssection is completely empty - noeditorsarray, no language breakdowns, no line metrics.Only chat activity is tracked:
code_lines_accepted: 0,code_lines_suggested: 0Question
Are lines of code generated through GitHub Copilot's agent/agentic mode tracked in the usage metrics API?
Specifically:
total_code_lines_acceptedandtotal_code_lines_suggestedmetrics?Environment:
All reactions