NOTE: For information on support and assistance, click here.
ℹ️ v3.0 — New Copilot Usage Metrics API
As of v3.0, Copilot Metrics Viewer uses the Copilot Usage Metrics API. The legacy Copilot Metrics API was shut down on April 2, 2026 and is no longer available.
What's new in v3.0:
- Uses the async Copilot Usage Metrics API for all data
- Historical mode with PostgreSQL for data beyond the 28-day rolling window
- Per-user metrics tab with individual usage breakdowns
- Team metrics derived from per-user data — no longer requires the deprecated team-level API endpoints
- Sync service for automated daily data collection
Your GitHub App needs "Organization Copilot metrics: Read" permission. See GitHub App Registration for setup details.
This application displays a set of charts with various metrics related to GitHub Copilot for your GitHub Organization or Enterprise Account. These visualizations are designed to provide clear representations of the data, making it easy to understand and analyze the impact and adoption of GitHub Copilot.
The application supports two operating modes:
| Mode | Description | Requirements | Team Metrics | Data Retention |
|---|---|---|---|---|
| Direct API | Fetches metrics directly from GitHub's API on each page load | GitHub token only | ❌ Not available | Rolling 28 days |
| Historical Mode | Reads from a local PostgreSQL database, synced daily | PostgreSQL + Sync service | ✅ Full history | Unlimited |
Direct API mode is the simplest setup — no database required. It returns the latest 28-day rolling window of data from the Copilot Usage Metrics API. Team-scoped views are not available in this mode because team metrics are derived from per-user records stored in the database.
Historical mode adds a PostgreSQL database and a sync service that downloads metrics daily. This enables:
- Viewing metrics beyond the 28-day API window
- Per-user time-series history with trend charts
- Team metrics — derived from stored per-user data filtered by team membership
See DEPLOYMENT.md for setup instructions for each mode.
Set NUXT_AUDIT_LOG_ENABLED=true to emit best-effort, single-line JSON audit events to server stdout; the default is disabled. Events include logins or email addresses, target users, IP addresses, and request metadata: restrict access to logs and set retention according to your privacy policy. sourceIp, when available, is the direct socket peer, which may be a reverse proxy; forwarded IP and request ID headers are not trusted as identity evidence. Successful user-metrics, seats, billing, and admin drill-down reads are recorded after retrieval; OAuth errors and authorization denials are also recorded. Audit logging does not cover every endpoint or replace access controls. Never put credentials in query parameters or audit detail values.
The GitHub Copilot Metrics Viewer provides comprehensive analytics through an intuitive dashboard interface:
Users can now filter metrics for custom date ranges up to 100 days, with an intuitive calendar picker interface. The system also supports excluding weekends and holidays from calculations.
Select one team for a full deep-dive view with KPI tiles, time-series charts (acceptance rate, active users, feature usage, model usage), language and editor breakdowns, and a per-user activity table. Select two or more teams to compare them side by side.
Note
GitHub does not provide a pre-aggregated team usage report. This application's team metrics are a current-membership view: per-user daily activity is filtered to members returned by the GitHub Teams API at request time. This works in Direct API mode and Historical mode, but it is not a membership-at-the-time historical report.
GitHub's historical team recipe joins each day's user-teams and per-user activity reports on (user_id, day, organization_id/enterprise_id) before rolling up. We do not currently fetch or persist those daily membership reports, so membership changes can misattribute earlier activity in this dashboard. The official user-teams reports omit teams with fewer than 5 seated Copilot users; our current-membership view can include those smaller teams and must not be mistaken for that official join.
Users on multiple teams contribute to each team. Team totals must not be summed to derive organization totals. Distinct-user windows are computed from per-user records, not by adding daily active-user counts.
Single team deep dive:
Multi-team comparison:
Both the deep-dive and comparison views include team-level AI contribution and adoption reporting.
AI contribution scorecards — per team: Agent share of Copilot-added LOC, Copilot / agent / CLI adoption, and VS Code agent users. Raw LOC counts and LOC-per-person metrics are intentionally omitted.
Agent share of Copilot-added LOC trend chart — direct Agent/Edit-mode file additions as a percentage of all Copilot-added lines, with one line per selected team. Days without tracked LOC are gaps rather than zeroes.
Team leaderboard — ranks the selected teams by Agent share of Copilot-added LOC by default, with a trend arrow comparing the later half of the selected range against the earlier half.
Adoption heatmap — weekly adoption percentage per team, with a summary naming the highest- and lowest-adoption teams.
Weekly merged pull requests — on-demand panels in both single-team and comparison views show weekly merged PR counts, AI-touched PRs, a rolling weekly average and merged PRs per person. Each comparison panel is labelled by team. Changing teams or the date range clears loaded PR data so stale results are never shown for a new selection.
GitHub search only counts pull requests in repositories the server's GitHub
credential can read, so this report needs read access to the organization's
repositories: the repo scope for a classic PAT or OAuth token, or
Pull requests: Read-only on all repositories for a fine-grained PAT or
GitHub App. Without it, the card shows an access error instead of empty weeks.
PRs Merged comparison cards — one KPI tile per selected team displays its merged count for the selected range, populated by the same on-demand request as the weekly panel. Choose PRs Merged or PRs Merged per person in the team leaderboard to rank loaded teams. Unloaded teams show "Not loaded" and are not ranked; incomplete member searches show a lower-bound marker (≥). PR trends compare average counts in the later versus earlier half of complete weeks, excluding partial weeks; fewer than two complete weeks or truncated results have no trend.
Adoption and usage comparisons use percentages or per-person figures. PR counts are also available as absolute totals for executive reporting; use the per-person leaderboard option when comparing differently sized teams.
| Metric | Source | Calculation |
|---|---|---|
| Agent share of Copilot-added LOC | totals_by_feature for agent_edit only |
Sum of direct-file loc_added_sum ÷ sum of top-level Copilot loc_added_sum, multiplied by 100 |
| Acceptance rate | code_acceptance_activity_count ÷ code_generation_activity_count |
Weighted across the range, not a mean of daily rates |
| Copilot / agent / CLI / VS Code agent adoption | Rolling distinct-user windows computed server-side | Distinct users ÷ team member count |
| Editor & model usage | totals_by_ide / totals_by_model_feature |
Share of each team's own interactions |
| Merged & AI-touched PRs | GitHub search API (on demand) | See below |
Assumptions worth knowing:
- Agent share is not "% of all code written by AI." The Copilot API reports no human-authored line counts. The numerator is
agent_editadditions, including direct file edits from both Agent and Edit mode; the denominator includes all Copilot additions (accepted completions, chat-panel copy/apply actions, inline chat and direct file edits).chat_panel_agent_modecopy/apply additions remain in the denominator, not the numerator. Deletions and suggestions are excluded. These are editor events, not retained or merged code, and IDE telemetry/version coverage affects them. See LoC definitions. - Both Teams and Agent Activity use the same added-lines share. Agent Activity previously showed a changed-lines share including deletions; its other added/deleted volume charts remain unchanged in purpose. Missing added LOC produces an em dash or a chart gap, not 0% contribution.
- Adoption denominators are current team members, not licensed seats. A team whose member count cannot be resolved shows an em dash rather than a misleading zero.
- Adoption percentages saturate at 100% as a display guard, not a fix for membership attribution. The team aggregation filters historical activity to current members; it cannot tell which teams a user belonged to on an earlier day.
- Adoption numerators come from rolling windows (7-day for ranges up to a week, 28-day otherwise), read from the last day in range. Per-day report rows expose active-user counts, never identities, so distinct users across an arbitrary range cannot be recomputed on the client — and exposing identities would conflict with the per-user privacy gate.
- Trends compare the later half of the selected range against the earlier half, not a separately fetched preceding period. This avoids doubling every team's API cost and is labelled as such in the UI.
- VS Code agents-window usage is an approximation. The API exposes
totals_by_ideandtotals_by_featureseparately with no IDE × feature cross-product, so a user counts when they have a VS Code entry and agent usage on the same day. - Weeks start on Monday. Partial weeks at either end of the range are flagged in the PR chart and excluded from the rolling average.
GitHub's Copilot metrics API reports pull request totals only for whole organizations and enterprises, never for teams. Upstream approaches that copy org-wide totals into a team's rows mislabel org numbers as team numbers, so this dashboard instead queries the GitHub search API for the team's members.
- A PR counts as AI-touched when it was authored by the Copilot coding agent or reviewed by Copilot code review.
- Member logins are chunked to stay under the search API's 256-character query limit, and all weeks and chunks are batched into a single GraphQL request using aliases.
- Because search is rate limited, the panel loads only when you click "Load PR data", and results are cached per team and date range (in PostgreSQL when
DATABASE_URLis set, otherwise in memory for an hour). - If GitHub rate limits the request, the panel reports how many minutes to wait before retrying rather than failing silently.
Note
Mock team requests use the same member-filtered per-user aggregation as live team requests. Organization and enterprise teams share the bundled per-day organization user fixture, with all fixture dates shifted together to end on the selected end date (or today). Real report dates are unchanged. Historical team queries read the preceding 27 days before filtering output to the selected range, so rolling adoption counts include earlier activity. Active-user percentages use the shared capped adoption calculation for both cards and charts.
You can link directly to a fully team-scoped dashboard — every tab (IDE metrics, chat, agents, languages, etc.) will automatically filter to that team's members only. A blue banner at the top of the page confirms the active scope and provides a quick link back to the organization view.
https://<your-host>/orgs/<org>/teams/<team>
https://<your-host>/enterprises/<enterprise>/teams/<team>
Examples:
http://localhost:3000/orgs/octo-demo-org/teams/the-a-teamhttp://localhost:3000/enterprises/octo-demo-ent/teams/the-a-teamhttp://localhost:3000/orgs/mocked-org/teams/the-a-team?mock=true(mock data)
View individual user-level Copilot usage metrics including code completions, chat interactions, and code review activity. Summary tiles show total users, active users, and average acceptance rate.
In Historical mode (with PostgreSQL), the User Metrics tab also displays per-user time-series history charts, allowing you to track individual adoption trends over time.
The per-user table includes an AI Credits column showing each user's premium-request spend (sourced from the ai_credits_used field that GitHub added to the users-28-day Copilot metrics report on 2026-06-19). The column shows — when GitHub hasn't reported credits for the period (e.g., older mock data or enterprises that haven't enabled premium-request billing).
Personal dashboard for the currently-authenticated user. Shows your own active days, interactions, accepted lines, AI credits used, top IDE, and top model — filtered server-side by session.user.login so you can never see another user's data from this tab.
Visible to every authenticated user when any auth provider is configured (NUXT_PUBLIC_AUTH_PROVIDERS). Hidden when the app is running in PAT-only / no-auth mode, because there is no session user to filter by.
Aggregate AI credit billing breakdown by model, SKU, cost center, and repository — pulled from the GitHub Billing API (/organizations/{org}/settings/billing/ai_credit/usage and /enterprises/{ent}/settings/billing/ai_credit/usage). Also includes a per-user breakdown table that joins the org's user list with each user's billing spend (lazy-loaded one page at a time), with "Top spenders" and "Top CLI token users" charts.
Global Top spenders: the admin-only Billing CSV ranking covers the entire configured billing enterprise and selected period, independently of the lazy-loaded table or metrics roster. It ranks the top ten by net cost; fully discounted periods with zero net leaders are re-ranked globally by gross cost. The heading and tooltips identify the selected metric. A completed CSV ingest must cover the entire selected period; otherwise the chart explains the missing coverage and links to the Admin Panel and setup instructions. A successfully ingested period with no positive spend shows no bars. The separate live billing and individual user pages are never substituted for a global ranking. The API's metric=auto opts into this behavior and returns the selected metric; explicit netAmount, grossAmount, and credits rankings retain their meaning.
Visibility:
- When
NUXT_GITHUB_BILLING_TOKENis not configured — the tab is shown to every dashboard user, but renders only a configuration-help placeholder (no data is fetched). This is a discoverability aid so operators learn the feature exists. - When
NUXT_GITHUB_BILLING_TOKENis configured — the tab is admin-only: visible only to users on theNUXT_USAGE_ADMINSallowlist. In PAT-mode deployments (no OAuth provider configured) the allowlist is bypassed and the tab is visible to anyone who can reach the dashboard.
Why a separate token? Billing endpoints have stricter auth than metrics endpoints — they require a classic PAT with manage_billing:enterprise (for enterprise-owned orgs, SSO-authorized for the enterprise if enforced) or manage_billing:copilot (for standalone orgs). Fine-grained PATs and GitHub Apps cannot read billing today. Keeping NUXT_GITHUB_BILLING_TOKEN separate from NUXT_GITHUB_TOKEN means your metrics calls can keep using a GitHub App / fine-grained PAT while only billing uses the classic PAT.
Which billing endpoint gets called?
- Standalone organizations (no parent enterprise): billing calls go to
/organizations/{org}/settings/billing/ai_credit/usageautomatically — leaveNUXT_BILLING_ENTERPRISEunset. A classic PAT withmanage_billing:copilotscope is sufficient. - Enterprise-owned organizations (org billing consolidated under an enterprise): the org-level endpoint returns 404 because billing lives at the enterprise level. Set
NUXT_BILLING_ENTERPRISE=<enterprise-slug>to route billing calls to/enterprises/{slug}/...— use a classic PAT withmanage_billing:enterprisescope, SSO-authorized for that enterprise. Without this override an org-scoped dashboard will see a 404 with a hint pointing at the variable.
Not sure which one applies to you? Call GET /orgs/<your-org> and look at the enterprise field — null means standalone, an object with a slug means enterprise-owned (use that slug).
Per-user attribution caveat: per-user billing depends on attributable billing rows. If successfully checked users have no spend while the aggregate has spend, the Billing tab explains only that checked batch: successful empty results are zero, while unvisited users remain unknown and failures show unavailable. The table, pagination, token chart, and user insights remain available; an empty batch does not establish enterprise-wide non-attribution, an identity mismatch, or a billing-plan diagnosis. The My Usage tab and the User Metrics ai_credits_used column are independent of this and still work.
Bounded per-user loading and sorting: each explicit page/sort action checks only that page (10, 25, or 50 users), reusing successfully loaded results for the current billing window. Billing columns (Credits, Gross $, Net $, Models) sort within the current alphabetically grouped page, not across the enterprise or a partially loaded cache. User and Tokens sorts use the full Metrics API user list. Billing responses cannot advance through unvisited pages automatically. This does not implement global spend-sorted pagination; the separate Billing CSV top-spenders chart remains independent.
EMU identity aliases: GitHub-supplied opaque billing usernames can differ from Metrics API logins. Operators may set the server-only NUXT_BILLING_USER_ALIASES to a JSON object mapping billing username → metrics login, for example {"opaque_fake":"fake-user"}. Use only independently verified mappings; no handle guessing or client-provided mapping is supported. Keys and values are trimmed and case-insensitive; multiple billing keys may resolve to one login. Direct and aliased billing lines are counted once each. Chains, cycles, conflicting case-normalized keys, and malformed/non-string entries fail explicitly with a service error rather than showing zero. The mapping is deployment-wide, so all configured billing scopes must use the same verified identities; do not share a mapping across scopes where a handle has different owners.
Per-user responses check only requested logins and aliases, not an authoritative enterprise roster. identityReconciliation: "unknown" does not assert that absent rows or off-page users are unmatched. No global unmatched usernames/count is returned. The UI distinguishes failed/not-yet-loaded billing from a successful zero; upstream partial failures are errors, not partial totals. Existing admin-only billing access, team membership checks, and self-row restrictions on metrics are unchanged. A future bounded authoritative-roster contract is needed for complete reconciliation.
The isolated identity SQL/HTTP suite uses an owned disposable Postgres container: npm test -- --run --config tests/billing-identity.config.ts (Docker required; never uses the application database).
Each username in the Per-user breakdown table is a clickable chip. Selecting a chip reveals an inline User insights section directly below the table with that user's full Copilot activity report — the same view the user would see on their own My Usage tab (Active days, Interactions, Accepted lines, AI credits used, per-model spend, top IDE / language / model, day-by-day charts).
No user selected → the section shows an info banner explaining the feature. Clicking a chip a second time (or "Clear selection") returns to the banner state.
Requires NUXT_GITHUB_BILLING_TOKEN (always) and — only for enterprise-owned orgs — NUXT_BILLING_ENTERPRISE. Standalone orgs work without the enterprise slug. The drill-down endpoint (/api/my-usage?login=<other>) is gated by NUXT_USAGE_ADMINS; non-admins receive 403. In PAT-only deployments the operator is admin-by-PAT and the drill-down works without an OAuth session.
The live billing endpoints cap windows at ~31 days and rate-limit aggressively. For longer historical analysis, the dashboard can pull GitHub's enterprise billing CSV exports into a local Postgres table, then serve the Billing tab from the cache.
CSV ingestion supports the legacy 17-column prefix and preserves the optional input, output, cache_read, and cache_write token counts documented by GitHub. Optional columns are mapped by name after the required prefix; unknown extra columns remain tolerated. Missing optional headers and empty numeric cells default to zero; malformed present numeric cells fail ingestion through its existing error reporting. Values follow the existing finite JavaScript-number parser contract, without token/currency conversions, and are stored as PostgreSQL NUMERIC without fixed-scale rounding. Schema upgrades are additive; previously discarded tokens require re-ingestion to recover. This does not add token visualizations or change other billing totals.
The isolated real-PostgreSQL regression suite runs with npm test -- --run --config tests/billing-token-storage.config.ts (requires Docker and postgres:16-alpine; uses an owned container and random loopback port).
The separate authoritative roster storage foundation documents complete-only user-report coverage and versioned current GitHub team membership (24-hour freshness). It is an internal prerequisite for bounded billing sorting, not a new billing UI/API; virtual reports-to membership remains unavailable.
When the cache covers the selected window, the Billing tab serves data from the DB and shows a small "Source: local cache" chip with the last-synced timestamp. When the window is partially or not covered, it falls back to the live API automatically.
For a single-month window with a positive CSV quota, the admin Billing tab shows the enterprise Monthly quota and the selected window's Used % of quota. The quota is the most frequent total_monthly_quota across enterprise rows in the selected window (the smaller value wins ties), not a sum; this tolerates occasional inflated historical duplicate-key rows. Usage is gross aic_quantity in AI credits, including discounted usage, rather than native request quantities or net charges. Filters narrow usage but not the enterprise quota. Partial-month windows show partial usage against the monthly quota; multi-month windows, zero or absent quotas, and live API data omit these tiles. The CSV fixture does not establish the quota's units; this comparison assumes GitHub reports it in AI credits.
Triggering an ingest (admin panel → Billing CSV ingest):
- Pick a date range (defaults to last 30 days through today)
- Leave "Skip already-ingested ranges" checked to fetch only the gaps in your selected window — re-running for an overlapping range becomes cheap
- Submit; the job runs in the background, polled by the recent-jobs table
GitHub builds the export server-side and returns one or more signed download URLs (60-minute TTL). The ingester downloads, parses, dedupes by primary key, and bulk-upserts into the billing_credit_usage table. Multi-month windows are chunked at ≤31 days internally — you can request months of data in a single click.
The recent-jobs table shows status, row count, who triggered, and a hover tooltip on the row count surfacing what was fetched vs. skipped (so you can verify gap-mode actually pruned re-fetches of already-ingested ranges).
Requires: an enterprise-owned org — the CSV export endpoint (/enterprises/{slug}/settings/billing/usage_report) is enterprise-only. Standalone orgs must use the live Billing tab instead. Set NUXT_GITHUB_BILLING_TOKEN to a classic PAT with manage_billing:enterprise (SSO-authorized if enforced) and NUXT_BILLING_ENTERPRISE to the enterprise slug. Postgres must be configured (see the storage section).
Personal Copilot activity for the signed-in user only — server-side filtered against the session. Surfaces:
ai_credits_usedtotals + per-day chart (when a date range is selected)- Your AI credit spend — total $, credits billed, per-model breakdown (requires
NUXT_GITHUB_BILLING_TOKEN; the call always sends?user=<session-login>and is never user-controllable) - GitHub CLI usage card (sessions, requests, prompt/output token sums, CLI version) when the user has CLI activity
- AI adoption-phase chip and top-IDE/plugin versions
View model usage analytics including model adoption over time, chat model distribution, and usage per chat mode (Ask, Agent, Edit, Inline).
Export your metrics data in multiple formats for further analysis or reporting. Options include summary reports, full detailed exports, and direct clipboard copying.
Table exports (CSV, opens in Excel): User Metrics, its snapshot history, language/IDE breakdowns, model/feature lists, and raw billing line items offer Export CSV. They export the supplied permitted rows across local table pages, retaining search/activity filters and the active sort. User Metrics never enumerates additional server pages or expands a server response cap (including the 500-row cap where enabled); non-admin users can export only their own server-permitted row. Only displayed data columns are exported, not hidden metadata or trend buttons.
The admin-only Per-user breakdown in Billing offers Export all matching users CSV. It loads billing for every matching user in the permitted Metrics API roster (not just the visible table page), following its server pagination and fetching billing in batches of at most 50 through the existing admin-checked billing endpoint. The export applies the selected sort across those matching rows after loading; the on-screen billing-column sort remains page-local. This explicit action may make many requests (each user-metrics response remains capped at 500); it does not discover users beyond the server-permitted roster or substitute enterprise-wide billing attribution. Failed batches prevent a partial/misleading download; use Retry per-user billing before exporting again. Changing scope, period, search, or sort during a download cancels that result.
All table downloads use UTF-8 with a BOM for Excel, CRLF rows, CSV quoting, and the shared seat-export escaping helper. Untrusted text with formula prefixes (=, +, -, @, including whitespace/control prefixes), or leading tab/CR, is prefixed with an apostrophe. No .xlsx dependency is required. Seat exports retain their separate current-page-only scope (see below).
Note
Metrics details are described in detail in the Copilot Usage Metrics API documentation
Here are the key metrics visualized in these charts:
- Active Users Over Time: Tracks daily, weekly, and monthly active users across all Copilot features — IDE completions, chat, agent mode, CLI, and PR summaries.
- Feature Usage Over Time: Shows user-initiated interactions per feature per day, covering IDE chat, agent mode, edit mode, inline chat, CLI, PR summaries, and more.
-
Code Completions: Tracks total inline code suggestions shown and accepted over time.
-
Total Lines Suggested: Showcases the total number of lines of code suggested by GitHub Copilot. This gives an idea of the volume of code generation and assistance provided.
-
Total Lines Accepted: As the name suggests, the total lines of code accepted by users (full acceptances) offering insights into how much of the suggested code is actually being utilized and incorporated into the codebase.
- Total Active Users: Represents the number of active users engaging with GitHub Copilot. This helps in understanding the user base growth and adoption rate.
Pie charts with the top 5 languages by accepted prompts and acceptance rate (by count/by lines) are displayed at the top.
The language breakdown analysis tab also displays a table showing the Accepted Prompts, Accepted Lines of Code, and Acceptance Rate (%) for each language over the selected time period. The entries are sorted by the number of accepted lines of code descending.
-
Cumulative Number of Turns: This metric represents the total number of turns (interactions) with the Copilot over the selected time period. A 'turn' includes both user inputs and Copilot's responses.
-
Cumulative Number of Acceptances: This metric shows the total number of lines of code suggested by Copilot that have been accepted by users over the selected time period.
-
Total Turns | Total Acceptances Count: This is a chart that displays the total number of turns and acceptances.
-
Total Active Copilot Chat Users: A bar chart that illustrates the total number of users who have actively interacted with Copilot over the selected time period.
-
Total Assigned: This metric represents the total number of Copilot seats assigned within the current organization/enterprise.
-
Assigned But Never Used: This metric shows seats that were assigned but never used within the current organization/enterprise. The assigned timestamp is also displayed in the chart.
-
No Activity in the Last 7 Days: Never used seats or seats used, but with no activity in the past 7 days.
-
No Activity in the Last 7 Days (including never used seats): A table to display seats that have had no activity in the past 7 days, ordered by the date of last activity. Seats that were used earlier are displayed at the top.
In Permitted seat details, Export current page (CSV) downloads only the rows currently displayed, in their current table sort order. Changing the page changes the exported rows; an empty page disables the action. The file includes exactly the seven visible columns: S.No, Login, GitHub ID, Assigning team, Assigned time (including the displayed plan), Last Activity At, and Last Activity Editor. Row numbering retains the page offset.
The export uses the already-loaded, permission-filtered page without additional requests or access changes. It does not export all seats, other pages, hidden fields, anonymous summary totals, or other dashboard tables. Untrusted text is CSV-escaped; text beginning with =, +, -, or @ (including whitespace/control prefixes) is prefixed with an apostrophe to prevent spreadsheet formula evaluation. Numeric zero is preserved.
Investigation for #448: the live /api/seats path maps GitHub's /copilot/billing/seats response, deduplicates enterprise users, applies permission/team filters, and paginates it; it does not maintain a separate departed-user list. GitHub documents these endpoints as seats currently being billed, not an authoritative current enterprise membership directory. Revoking a seat can set pending_cancellation_date until the end of the billing cycle. Pending cancellation is therefore not proof of enterprise departure, and filtering those seats would hide legitimate billed seats. The current seat model does not preserve that cancellation date, so no inferred cancellation/membership marker is added.
When historical storage is configured, /api/seats prefers the latest stored seat snapshot (even with live authentication). That snapshot can retain departed users until a subsequent successful seat sync replaces it. Check the source/sync freshness and GitHub's returned seats when diagnosing an example. No authoritative membership reconciliation, stale-snapshot policy, or departed-user filtering is implemented here; that part of #448 remains open and needs a concrete reproduction and membership/source semantics before changing totals.
When billing and user metrics have been imported, the per-user billing table sorts stored per-user totals before pagination in PostgreSQL. Credits, Gross $, Net $, and Models include all stored items/models for each canonical login, including configured NUXT_BILLING_USER_ALIASES. Pages contain 10, 25, or 50 users; users without a stored billing row show No stored billing data, not zero.
The sorted dataset is the stored usage roster, not every enterprise identity or the global top-spenders chart. User/CLI token dates follow the dashboard's usage window (or the latest 28 stored days); billing dates follow the selected billing month or date range. Organization queries restrict billing to that organization. Team queries use the existing published membership snapshot, including inactive members; unavailable/stale membership disables stored sorting rather than broadening the scope. Reports-to groups retain the existing User/Token sorting and lazy billing loading.
The table displays the selected billing dates and Last imported (the latest successful import overlapping those dates). That timestamp is informational: it does not certify complete imports, matched identities, current membership, or live GitHub freshness. No complete daily usage coverage or identity-match guarantee is required. Database-configured deployments can open the same admin-gated table without a live billing token.
Without stored billing for the selected scope/period, billing-column sorting is disabled with an import hint. User and Tokens sorting remains available, and live billing is loaded only for the visible page. Failed or pending requests are never shown as zero. The stored page endpoint (/api/billing-user-page) uses the existing billing admin gate and does not call GitHub or download a full roster.
The application supports flexible date range selection allowing users to analyze metrics for any period up to 100 days. The date picker provides an intuitive calendar interface with options to exclude weekends and holidays from the analysis.
Multiple export options are available in the API Response tab:
- Download CSV (Summary): Exports key metrics in a condensed format
- Download CSV (Full): Exports comprehensive detailed data
- Copy Metrics to Clipboard: Quick copy functionality for immediate use
- Check Metric Data Quality: Validates data integrity and completeness
Organizations can compare metrics across different teams to:
- Identify high-performing teams
- Understand adoption patterns
- Share best practices across teams
- Monitor team-specific engagement levels
Note
Team metrics are derived from per-user data by resolving GitHub team membership and aggregating. The GitHub Copilot Usage Metrics API does not have dedicated team endpoints — this application computes team views automatically. In Direct API mode, team data covers the latest 28-day window. In Historical mode (with PostgreSQL), full historical team trends are available.
Detailed insights into AI model usage including:
- IDE Code Completions by editor and model type
- IDE Chat interactions and model preferences
- GitHub.com Chat usage patterns
- PR Summary generation statistics
- Custom vs. default model adoption rates
In the .env file, you can configure several environment variables that control the behavior of the application.
Public variables:
NUXT_PUBLIC_IS_DATA_MOCKEDNUXT_PUBLIC_SCOPENUXT_PUBLIC_GITHUB_ENTNUXT_PUBLIC_GITHUB_ORGNUXT_PUBLIC_HIDDEN_TABS
can be overridden by route parameters, e.g.
http://localhost:3000/enterprises/octo-demo-enthttp://localhost:3000/orgs/octo-demo-orghttp://localhost:3000/orgs/octo-demo-org/teams/the-a-teamhttp://localhost:3000/enterprises/octo-demo-ent/teams/the-a-teamhttp://localhost:3000/orgs/mocked-org?mock=true
When navigating to a team-scoped URL, a blue banner appears at the top confirming the active team scope and offering a Back to org button. All tabs automatically filter to team members only.
The NUXT_PUBLIC_SCOPE environment variable in the .env file determines the default scope of the API calls made by the application. It can be set to 'enterprise' or 'organization'.
- If set to
'enterprise', the application will target API calls to the GitHub Enterprise account defined in theNUXT_PUBLIC_GITHUB_ENTvariable. - If set to
'organization', the application will target API calls to the GitHub Organization account defined in theNUXT_PUBLIC_GITHUB_ORGvariable. - To view team-level metrics, use the Teams tab or navigate to
/orgs/<org>/teams/<team>— team filtering is applied as a post-processing step.
Note: Legacy values
'team-organization'and'team-enterprise'are still accepted and automatically normalized to'organization'and'enterprise'respectively for backward compatibility.
GitHub App authentication resolves only installations matching the requested account
type. Enterprise installations use the account's slug and the installation's
target_type; organization installations use the account's login. Explicit
request identifiers override deployment defaults, and enterprise requests do not
fall back to an organization identifier. The standalone sync job likewise uses
the identifier and installation type for its configured scope.
Finding the installation does not grant additional permissions. GitHub App authentication errors are propagated rather than retried with a configured PAT or OAuth token. A report endpoint can still return 403 after successful installation-token creation; consult the enterprise usage metrics API documentation for its authorization requirements.
For example, if you want to target the API calls to an organization, you would set NUXT_PUBLIC_SCOPE=organization in the .env file.
[!INFO] Environment variables with
NUXT_PUBLICscope are available in the browser (are public). See Nuxt Runtime Config for details.
NUXT_PUBLIC_SCOPE=organization
NUXT_PUBLIC_GITHUB_ORG=<YOUR-ORGANIZATION>
NUXT_PUBLIC_GITHUB_ENT=
Variable is false by default. To view mocked data switch it to true or use query parameter ?mock=true.
NUXT_PUBLIC_IS_DATA_MOCKED=false
Specifies the GitHub Personal Access Token utilized for metrics API requests. Generate this token with the following permissions: Read access to members, organization copilot metrics, and organization copilot seat management.
The Teams tab's weekly merged-PR report also needs read access to the organization's repositories (classic PAT: repo; fine-grained PAT: Pull requests: Read-only on all repositories). Without it, that report shows an access error; the rest of the dashboard is unaffected.
This token does not need billing scopes — billing has its own dedicated token (see NUXT_GITHUB_BILLING_TOKEN below). Keeping the two separate means metrics can keep using a fine-grained PAT or GitHub App, while only billing requires a classic PAT.
Important
v3.0 Migration: The new Copilot Usage Metrics API requires Read access to members, organization copilot metrics, and organization copilot seat management permissions. Without this, the new API endpoints will return 400/403 errors. See GitHub App Registration for setup details.
Token is not used in the frontend.
NUXT_GITHUB_TOKEN=
Optional. Dedicated classic PAT for the Billing tab and per-user AI credit spend. When unset, the Billing tab is hidden and the "Your AI credit spend" card on the My Usage tab is omitted — all other features keep working.
Requirements:
- Classic PAT only — fine-grained PATs and GitHub Apps cannot read billing.
- Scope:
manage_billing:enterprise(ormanage_billing:copilotfor non-enterprise-owned orgs). - Must be SSO-authorized for the target enterprise if SAML SSO is enforced.
NUXT_GITHUB_BILLING_TOKEN=ghp_classic_pat_with_manage_billing_enterprise
Optional. Enable the chat assistant with NUXT_PUBLIC_ENABLE_AI_CHAT=true. It calls any OpenAI-compatible /chat/completions endpoint (OpenAI, Azure OpenAI /openai/v1, Ollama, LiteLLM, OpenRouter, ...) with an API key. The GitHub Models API is retired and no longer used; NUXT_AI_TOKEN and the per-user "personal token" option were removed.
| Variable | Default | Description |
|---|---|---|
NUXT_AI_API_KEY |
(none) | API key, sent as Authorization: Bearer. Server-only. Chat returns a setup message until it is set. |
NUXT_AI_BASE_URL |
https://api.openai.com/v1 |
Base URL; /chat/completions is appended. Server config only, never taken from requests. |
NUXT_AI_MODEL |
gpt-4o |
Model or deployment name. |
NUXT_AI_MAX_TOOL_ROUNDS |
5 |
Max tool-calling iterations per question. |
Optional. Set only when your organization's billing is consolidated under a GitHub enterprise. When set, it forces billing calls to /enterprises/{slug}/settings/billing/ai_credit/usage regardless of the dashboard's scope.
Leave unset for standalone organizations — the app will automatically use /organizations/{org}/settings/billing/ai_credit/usage, which is the correct endpoint for orgs that aren't part of an enterprise.
To check whether your org is enterprise-owned:
curl -H "Authorization: token <PAT>" https://api.github.com/orgs/<your-org> | jq '.enterprise'null → standalone (leave NUXT_BILLING_ENTERPRISE unset); an object with a slug → enterprise-owned (use that slug).
NUXT_BILLING_ENTERPRISE=my-enterprise-slug
If you get a 404 from the Billing tab with the dashboard scoped to an enterprise-owned organization, the error message will point you at this variable.
Optional. Overrides the GitHub API base URL used for all server-side API calls. Set this when accessing GitHub at GHE.com (GitHub Enterprise Cloud with data residency), where the API is available at a dedicated subdomain.
NUXT_GITHUB_API_BASE_URL=https://api.SUBDOMAIN.ghe.com
Defaults to https://api.github.com when not set. Leave unset for standard GitHub.com and GitHub Enterprise Cloud (non-data-residency) deployments.
Note
GHES (GitHub Enterprise Server) is not supported — the Copilot usage metrics API is not available on GHES.
Alternative to PAT — use a GitHub App installation token for backend data access. When both are set, they take priority over NUXT_GITHUB_TOKEN. This is the recommended credential when users authenticate via Google, Microsoft, Auth0, or Keycloak (i.e., non-GitHub identity providers), since the token is machine-issued and not tied to any individual user account.
The installation ID is auto-discovered from NUXT_PUBLIC_GITHUB_ORG — no manual configuration needed. If the App is installed on multiple orgs and no org is configured, users see an org picker after login.
See GitHub App Installation Token in the deployment guide for full setup instructions.
NUXT_GITHUB_APP_ID=123456
NUXT_GITHUB_APP_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----This variable is required to encrypt user sessions, it needs to be at least 32 characters long. For more information see Nuxt Sessions and Authentication.
Warning
This variable is required starting from version 2.0.0.
Comma-separated list of active OAuth providers: github, google, microsoft, auth0, keycloak. Setting this variable enables authentication — users must sign in before accessing the dashboard.
NUXT_PUBLIC_AUTH_PROVIDERS=github,google
The corresponding NUXT_OAUTH_<PROVIDER>_CLIENT_ID and NUXT_OAUTH_<PROVIDER>_CLIENT_SECRET must also be set. See Authentication in DEPLOYMENT.md for full setup instructions per provider.
Comma-separated list of logins or email addresses that are allowed to sign in (any provider). When empty (default), all authenticated users are allowed.
NUXT_AUTHORIZED_USERS=alice,bob@company.com
Comma-separated list of email domains allowed to sign in. When empty (default), no domain restriction is applied.
NUXT_AUTHORIZED_EMAIL_DOMAINS=company.com
Comma-separated allowlist of logins or email addresses that get administrator privileges on the dashboard. Administrators can:
- See the Billing tab (aggregate AI-credit breakdown by SKU/model/cost-center/repo)
- See all users' rows in the User Metrics tab and Seats Analysis
- Query any team on the Teams tab, including enterprise-scope team queries
- Use the
?login=<other-user>override on/api/my-usageand/api/user-metrics-history
The gate is opt-in: when NUXT_USAGE_ADMINS is empty (default), the admin gate is inactive and every authenticated caller is treated as an admin — the dashboard behaves as it did before the allowlist was introduced. Populate the variable to enable row-level scoping (e.g. for GDPR / Austrian works-council compliance per issue #398); once set, anyone not on the list is restricted to their own row.
# Opt-in mode: empty allowlist → gate inactive, all authenticated users see everything
NUXT_USAGE_ADMINS=
# Enable row-level scoping — only these logins/emails see cross-user data
NUXT_USAGE_ADMINS=alice,bob@company.com
Important
Behaviour changes across recent releases:
- 3.11.0 introduced
NUXT_USAGE_ADMINSas a closed-by-default gate (empty = nobody is admin). - The current release restores opt-in semantics: empty = everyone is admin. GitHub org owners no longer need to be listed to see other users' data unless you deliberately turn the gate on.
- There is no automatic elevation from GitHub org/enterprise roles — admin status is determined solely by this env var. If you want row-level scoping, list the small set of humans who should see cross-user data.
- PAT-mode (no OAuth provider configured —
NUXT_PUBLIC_REQUIRE_AUTH,NUXT_PUBLIC_USING_GITHUB_AUTH,NUXT_PUBLIC_IS_PUBLIC_APP,NUXT_PUBLIC_AUTH_PROVIDERSall unset) always bypasses this gate, because there is no per-user identity to gate on. Lock PAT-mode deployments down at the network layer.
Note
When NUXT_GITHUB_BILLING_TOKEN is unset, the Billing tab is shown to all users (admin or not) but renders a configuration-help placeholder instead of fetching data; the NUXT_USAGE_ADMINS gate only applies once the token is configured.
The Billing tab exposes aggregate breakdowns (model / SKU / cost center) and an admin per-user breakdown. Per-user attribution depends on attributable billing rows; an empty checked batch is explained without hiding the table or diagnosing enterprise-wide attribution. Other pages remain reachable and unknown until requested. The User Metrics ai_credits_used column and the My Usage spend card are independent of this.
Row-level scoping only applies when the allowlist is set. With an empty allowlist every column below reads as "✅ all" for every caller.
| Surface | Non-admin | Admin |
|---|---|---|
| Org / Enterprise aggregate metrics | ✅ all | ✅ all |
| My Usage tab (own data) | ✅ own | ✅ own |
| User Metrics tab | 🔒 own row only + banner | ✅ all rows |
| Seats Analysis tab | 🔒 own seat only | ✅ all seats |
| Teams tab — org scope | 🔒 only teams the caller is a member of | ✅ all teams |
Teams tab — enterprise scope with ?githubTeam= |
❌ 403 (GitHub has no enterprise-wide team-membership API) | ✅ all teams |
| Billing tab (token configured) | ❌ hidden | ✅ visible |
| Billing tab (token unset) | ⚙️ configuration-help placeholder | ⚙️ configuration-help placeholder |
The filter is enforced server-side — non-admin requests never receive other users' data over the wire. On the Teams tab, KPI tiles automatically switch to aggregate signals (rather than derived-from-user-rows) when the caller is row-restricted, so team totals still render correctly.
Seat and User Metrics KPI tiles use fixed-size anonymous summaries for the authorized
scope/team (and user-metrics date window), independently of permitted detail rows.
Seat pagination still counts only permitted rows. When a live organization seat request
resolves only a page, Total Assigned uses the provider's total; never-used and
inactivity totals display Unavailable, not page/self counts. Missing summaries also
display Unavailable. No additional full-seat fetch is made for these tiles.
/api/user-metrics remains an array; its anonymous counts and weighted acceptance-rate
inputs are carried in x-copilot-user-summary. Tables, searches and detail charts
remain restricted to permitted users.
Metrics endpoints (User Metrics, My Usage, Seats) accept any token type. Billing endpoints accept ONLY a classic PAT (which is why they have their own dedicated env var).
| Feature | Mock | GitHub App | Fine-grained PAT (NUXT_GITHUB_TOKEN) |
Classic PAT (NUXT_GITHUB_BILLING_TOKEN) |
|---|---|---|---|---|
| My Usage tab metrics | ✅ fixtures | ✅ | ✅ | ✅ |
User Metrics ai_credits_used column |
✅ fixtures | ✅ | ✅ | ✅ |
| My Usage "Your AI credit spend" card | ✅ fixtures | — | — | ✅ with manage_billing:enterprise (enterprise-owned orgs) or manage_billing:copilot (standalone orgs) |
| Billing tab (aggregate + per-user) | ✅ fixtures | — | — | ✅ with manage_billing:enterprise (enterprise-owned orgs) or manage_billing:copilot (standalone orgs) |
Even when on the admin allowlist, an admin only sees billing data if NUXT_GITHUB_BILLING_TOKEN is set AND the classic PAT has the right scope for the org's billing setup — manage_billing:enterprise (SSO-authorized for the target enterprise) for enterprise-owned orgs, or manage_billing:copilot for standalone orgs. If GitHub returns 403 or 404, the tab surfaces the message inline so it's clear which side needs adjustment (see NUXT_BILLING_ENTERPRISE above for the standalone-vs-enterprise-owned decision).
| Variable | Provider | Description |
|---|---|---|
NUXT_OAUTH_GITHUB_CLIENT_ID |
GitHub | App client ID |
NUXT_OAUTH_GITHUB_CLIENT_SECRET |
GitHub | App client secret |
NUXT_OAUTH_GOOGLE_CLIENT_ID |
OAuth client ID | |
NUXT_OAUTH_GOOGLE_CLIENT_SECRET |
OAuth client secret | |
NUXT_OAUTH_MICROSOFT_CLIENT_ID |
Microsoft | App client ID |
NUXT_OAUTH_MICROSOFT_CLIENT_SECRET |
Microsoft | App client secret |
NUXT_OAUTH_MICROSOFT_TENANT |
Microsoft | Azure AD tenant ID (restricts to org) |
NUXT_OAUTH_AUTH0_CLIENT_ID |
Auth0 | App client ID |
NUXT_OAUTH_AUTH0_CLIENT_SECRET |
Auth0 | App client secret |
NUXT_OAUTH_AUTH0_DOMAIN |
Auth0 | Tenant domain, e.g. company.auth0.com |
NUXT_OAUTH_KEYCLOAK_CLIENT_ID |
Keycloak | Client ID |
NUXT_OAUTH_KEYCLOAK_CLIENT_SECRET |
Keycloak | Client secret |
NUXT_OAUTH_KEYCLOAK_SERVER_URL |
Keycloak | Server URL |
NUXT_OAUTH_KEYCLOAK_REALM |
Keycloak | Realm name |
NUXT_PUBLIC_HIDDEN_TABS
Comma-separated list of dashboard tab names to hide. Applies at startup without requiring a rebuild — useful for pre-built Docker deployments. The filter is case-insensitive and trims surrounding whitespace.
Available tab names: languages, editors, copilot chat, agent activity, pull requests, github.com, seat analysis, user metrics, api response
# Hide the "Agent Activity" and "API Response" tabs
NUXT_PUBLIC_HIDDEN_TABS=agent activity,api response
Historical mode is enabled by simply setting DATABASE_URL to a PostgreSQL connection string. When set, the application stores and queries historical Copilot metrics from the database, exposes the /api/*-history endpoints, and shows the Teams comparison tab.
There is no separate NUXT_PUBLIC_ENABLE_HISTORICAL_MODE flag — the client-side flag (config.public.enableHistoricalMode) is derived from DATABASE_URL at server boot to guarantee the client and server can never drift.
Important
The Teams tab is automatically hidden when DATABASE_URL is not set. Team-level metrics are derived from per-user daily records in the database (user_day_metrics table). Without the database, the teams comparison tab would display identical org-wide data for every team.
# Enable historical mode by setting a Postgres connection string:
DATABASE_URL=postgres://user:password@host:5432/copilot_metrics
Optional site-wide announcement banner. When set to a non-empty string, an info banner with this text is shown at the top of the dashboard. Users can dismiss it for the current tab session; a new value re-shows the banner. Leave unset to hide the banner entirely.
NUXT_PUBLIC_ANNOUNCEMENT_MESSAGE=Scheduled maintenance on Sat 08:00 UTC — the sync container will be paused for ~30 minutes.
Solution supports HTTP Proxy settings when running in corporate environment. Simply set HTTP_PROXY environment variable.
For custom CA use environment variable CUSTOM_CA_PATH to load the certificate into proxy agent options.
Default is 80 in the Dockerfile. It defines the port number that Nitro (Nuxt’s server engine) will listen on.
For example, it should be set to a number between 1024 and 49151 if the application is run as a non-root user.
npm installnpm run devdocker build -t copilot-metrics-viewer .docker run -p 8080:80 --env-file ./.env copilot-metrics-viewerThe application will be accessible at http://localhost:8080
For Kubernetes deployments and health monitoring, the application provides dedicated health check endpoints that don't require authentication and don't make external API calls:
/api/health- General health check endpoint/api/ready- Readiness probe endpoint/api/live- Liveness probe endpoint
All endpoints return JSON responses with status information and respond in ~200ms, making them ideal for Kubernetes health checks instead of using the root / endpoint which triggers GitHub API calls.
livenessProbe:
httpGet:
path: /api/live
port: 80
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /api/ready
port: 80
initialDelaySeconds: 5
periodSeconds: 5This project is licensed under the terms of the MIT open source license. Please refer to MIT for the full terms.
This project is independently developed and maintained, and is not an official GitHub product. It thrives through the dedicated efforts of (@martedesco), (@karpikpl) and our wonderful contributors. A heartfelt thanks to all our contributors! ✨
I aim to provide support through GitHub Issues. While I strive to stay responsive, I can't guarantee immediate responses. For critical issues, please include "CRITICAL" in the title for quicker attention. 🙏🏼



















