GitHub Copilot integration with Coralogix
Coralogix observes GitHub Copilot in two complementary ways: one gives a high-level view of usage and billing, the other a granular, per-session picture of CLI activity.
Enable either or both:
- Usage and billing metrics (GitHub App) — a Coralogix-managed GitHub App reads your organizations' daily Copilot usage and billing reports and writes them to Coralogix as metrics.
- CLI session telemetry (Copilot CLI) — GitHub Copilot CLI ships with built-in OpenTelemetry that streams live, per-session detail (token usage, model calls, tool invocations, and per-turn agent activity) straight to Coralogix. Best for real-time, session-level inspection of CLI activity.
Once instrumented, your Copilot data lands in AI Center, then Code Agents, then Copilot, filterable by application name and subsystem (team).
Usage and billing metrics (GitHub App)
The GitHub Copilot Usage integration is a Coralogix-managed integration that collects your organizations' GitHub Copilot usage and billing data once a day and writes it to Coralogix as metrics. You authorize Coralogix once through GitHub and install the Coralogix GitHub App on the organizations you want to track. Coralogix then pulls the Copilot reports on a daily schedule from every organization the authorization can access — no agent, collector, or code to run on your side.
Once connected, you get organization-wide adoption and activity totals, per-user activity, team membership, and month-to-date billing as Prometheus-style gauges that you can chart, alert on, and join by user, team, model, IDE, feature, and language.
How it works
Each day, for every organization your authorization can access, Coralogix reads the following from GitHub for the previous day:
| Source | What it provides |
|---|---|
organization-1-day report | Org-wide active-user counts, activity totals, command-line interface (CLI) totals, pull-request metrics, AI-adoption-phase distribution, and per-IDE/feature/language/model breakdowns. |
users-1-day report | Per-user activity totals, CLI sub-metrics, and per-IDE/feature/language/model breakdowns. |
user-teams-1-day report | The user↔team memberships used to join per-user metrics to teams. |
Billing usage summary (product=copilot) | Month-to-date quantities and amounts per stock-keeping unit (SKU), model, and unit type. |
| Organization members (GraphQL) | Adds user_email and user_name labels to per-user metrics. |
Key behaviors to keep in mind when querying:
- All authorized organizations. Coralogix collects from every organization where the Coralogix GitHub App is installed and your authorization can reach it. Every metric carries an
organizationlabel, so you filter or break down by org. - Daily cadence. GitHub publishes a day's report during the following day, so the most recent data point trails the current time by up to a day plus the daily poll time.
- One sample per day. Every metric is stamped at
23:59:59 UTCof the report day. A daily aggregate describes the whole day, so it sits at the period close. - Daily totals, not cumulative. Activity counts (lines of code, interactions, active users, and so on) are the total for that report day. The
github_copilot_billing_*metrics are the exception — they are month-to-date values, re-published each day. - Absent values are skipped. A field that GitHub omits is never emitted as
0; the series does not exist for that day. A query that finds no series means "not reported," not "zero." - Breakdowns carry a
_by_<dimension>suffix (for example,..._by_ide) so they never collide with — or double-count against — the matching base totals.
What you need
- One or more GitHub organizations on a Copilot plan that exposes the Copilot metrics and billing APIs.
- App installation — the Coralogix GitHub App (
coralogix-copilot-observability) installed on each organization you want to track. Installation is a one-time step per organization that requires an organization admin, and grants the app its read-only permissions: Copilot metrics, organization members, and Administration (read) for billing. - Authorization — the Authorize step of the setup. Any GitHub user can complete it, but Coralogix only collects the data that user can personally access, so the authorizing user's permissions determine what the integration sees.
The permission the authorizing user needs, per dataset:
| Data | Permission the authorizing user needs |
|---|---|
| Copilot usage metrics (org, per-user, per-team) | Organization admin, or the fine-grained View organization Copilot metrics permission |
| Copilot cost and billing usage | Organization admin or billing manager |
| Member list and emails | Any team member |
View organization Copilot metrics is a GitHub custom organization role permission that grants read access to a single organization's Copilot usage metrics. An organization admin covers every dataset above. A user who has only that permission can authorize for usage metrics, but cost and billing data requires an organization admin or a billing manager. A plain member can authorize successfully, but the integration then gets 403s on the usage and billing data.
Set up
-
In Coralogix, navigate to Integrations, then select the GitHub Copilot Usage integration.
Select Connect, then fill in the basic fields:
Setting Required Purpose Integration name Yes A name for this integration in Coralogix. Defaults to GitHub Copilot Usage.Application name Yes Coralogix applicationtag applied to the ingested metrics. Defaults tocopilot.Subsystem name No Optional Coralogix subsystemtag for the ingested metrics. -
Select Authorize. Coralogix redirects you to GitHub to authorize the Coralogix GitHub App. Any GitHub user can complete this step, but Coralogix only collects the data that user can access — see the permissions under What you need above.
-
Approve the authorization, and install (or confirm) the
coralogix-copilot-observabilityapp on every organization whose Copilot usage you want to collect. You can add more organizations at any time. -
GitHub returns you to Coralogix and the integration finishes provisioning.
Once authorized, Coralogix discovers every organization the authorization can access and collects from all of them. After the first daily collection runs, search Metrics Explorer for the github_copilot_ prefix to confirm data is flowing.
If you authorize before the Coralogix GitHub App is installed on any organization, the integration is created but has nothing to collect. Install the app from https://github.com/apps/coralogix-copilot-observability on at least one organization on a Copilot plan. Collection starts on the next daily run. You can install it now or later.
Metrics reference
All metrics are gauges and appear in Metrics Explorer under the github_copilot_ prefix. Every series carries an organization label. Per-user series additionally carry user_login (always), user_id (when GitHub reports it), and user_email / user_name (when resolvable from organization members).
Billing (month-to-date)
One set per billing row, keyed by sku, unit_type, and — on premium-request rows — model.
| Metric | What it tracks |
|---|---|
github_copilot_billing_gross_quantity | Gross usage quantity for the SKU. |
github_copilot_billing_discount_quantity | Quantity covered by included allowances or discounts. |
github_copilot_billing_net_quantity | Billable quantity after discounts. |
github_copilot_billing_gross_amount | Gross monetary amount. |
github_copilot_billing_discount_amount | Discounted monetary amount. |
github_copilot_billing_net_amount | Net monetary amount charged. |
github_copilot_billing_price_per_unit | Unit price for the SKU. |
Organization activity
Org-wide totals from the organization-1-day report. Active-user counts and base activity totals carry only the organization label.
| Metric | What it tracks |
|---|---|
github_copilot_org_daily_active_users | Daily active Copilot users. |
github_copilot_org_weekly_active_users | Weekly active Copilot users. |
github_copilot_org_monthly_active_users | Monthly active Copilot users. |
github_copilot_org_daily_active_cli_users | Daily active Copilot CLI users. |
github_copilot_org_daily_active_copilot_cloud_agent_users | Daily active Copilot cloud-agent users. |
github_copilot_org_monthly_active_chat_users | Monthly active chat users. |
github_copilot_org_monthly_active_agent_users | Monthly active agent users. |
github_copilot_org_daily_active_copilot_code_review_users | Daily users who actively used Copilot code review. |
github_copilot_org_daily_passive_copilot_code_review_users | Daily users who received Copilot code review passively. |
github_copilot_org_code_generation_activity_count | Code-generation activities. |
github_copilot_org_code_acceptance_activity_count | Code-acceptance activities. |
github_copilot_org_user_initiated_interaction_count | User-initiated interactions. |
github_copilot_org_loc_suggested_to_add_sum | Lines of code suggested for addition. |
github_copilot_org_loc_suggested_to_delete_sum | Lines of code suggested for deletion. |
github_copilot_org_loc_added_sum | Lines of code added. |
github_copilot_org_loc_deleted_sum | Lines of code deleted. |
CLI totals (emitted only when the org used the CLI that day):
| Metric | What it tracks |
|---|---|
github_copilot_org_cli_session_count | CLI sessions. |
github_copilot_org_cli_request_count | CLI requests. |
github_copilot_org_cli_prompt_count | CLI prompts. |
github_copilot_org_cli_output_tokens_sum | CLI output tokens. |
github_copilot_org_cli_prompt_tokens_sum | CLI prompt tokens. |
github_copilot_org_cli_avg_tokens_per_request | Average tokens per CLI request. |
Pull-request metrics (emitted only when the report includes a pull-request section). The two ..._by_comment_type metrics carry an additional comment_type label.
| Metric | What it tracks |
|---|---|
github_copilot_org_pull_requests_created | Pull requests created. |
github_copilot_org_pull_requests_reviewed | Pull requests reviewed. |
github_copilot_org_pull_requests_merged | Pull requests merged. |
github_copilot_org_pull_requests_reviewed_by_copilot | Pull requests reviewed by Copilot. |
github_copilot_org_pull_requests_created_by_copilot | Pull requests created by Copilot. |
github_copilot_org_pull_requests_copilot_suggestions | Copilot review suggestions. |
github_copilot_org_pull_requests_copilot_applied_suggestions | Copilot review suggestions applied. |
github_copilot_org_pull_requests_suggestions | All review suggestions. |
github_copilot_org_pull_requests_applied_suggestions | All review suggestions applied. |
github_copilot_org_pull_requests_merged_created_by_copilot | Merged pull requests created by Copilot. |
github_copilot_org_pull_requests_merged_reviewed_by_copilot | Merged pull requests reviewed by Copilot. |
github_copilot_org_pull_requests_median_minutes_to_merge | Median minutes to merge. |
github_copilot_org_pull_requests_median_minutes_to_merge_copilot_authored | Median minutes to merge for Copilot-authored pull requests. |
github_copilot_org_pull_requests_median_minutes_to_merge_copilot_reviewed | Median minutes to merge for Copilot-reviewed pull requests. |
github_copilot_org_pull_requests_copilot_suggestions_by_comment_type | Copilot suggestions, by comment_type. |
github_copilot_org_pull_requests_copilot_applied_suggestions_by_comment_type | Applied Copilot suggestions, by comment_type. |
AI-adoption-phase distribution (one series per phase):
| Metric | What it tracks |
|---|---|
github_copilot_org_adoption_phase_engaged_users | Engaged users in the phase. |
github_copilot_org_adoption_phase_avg_user_initiated_interactions | Average user-initiated interactions per user in the phase. |
github_copilot_org_adoption_phase_avg_code_generation_activities | Average code-generation activities per user in the phase. |
github_copilot_org_adoption_phase_avg_code_acceptance_activities | Average code-acceptance activities per user in the phase. |
github_copilot_org_adoption_phase_avg_loc_added | Average lines of code added per user in the phase. |
Organization breakdowns
Org totals sliced by dimension. Each metric carries the dimension label(s) shown.
| Metric | Extra labels |
|---|---|
github_copilot_org_code_generation_activity_count_by_ide | ide |
github_copilot_org_code_acceptance_activity_count_by_ide | ide |
github_copilot_org_user_initiated_interaction_count_by_ide | ide |
github_copilot_org_loc_suggested_to_add_sum_by_ide | ide |
github_copilot_org_loc_suggested_to_delete_sum_by_ide | ide |
github_copilot_org_loc_added_sum_by_ide | ide |
github_copilot_org_loc_deleted_sum_by_ide | ide |
github_copilot_org_code_generation_activity_count_by_feature | feature |
github_copilot_org_code_acceptance_activity_count_by_feature | feature |
github_copilot_org_user_initiated_interaction_count_by_feature | feature |
github_copilot_org_loc_suggested_to_add_sum_by_feature | feature |
github_copilot_org_loc_suggested_to_delete_sum_by_feature | feature |
github_copilot_org_loc_added_sum_by_feature | feature |
github_copilot_org_loc_deleted_sum_by_feature | feature |
github_copilot_org_code_generation_activity_count_by_language_feature | language, feature |
github_copilot_org_code_acceptance_activity_count_by_language_feature | language, feature |
github_copilot_org_loc_suggested_to_add_sum_by_language_feature | language, feature |
github_copilot_org_loc_suggested_to_delete_sum_by_language_feature | language, feature |
github_copilot_org_loc_added_sum_by_language_feature | language, feature |
github_copilot_org_loc_deleted_sum_by_language_feature | language, feature |
github_copilot_org_user_initiated_interaction_count_by_model_feature | model, feature |
github_copilot_org_code_generation_activity_count_by_model_feature | model, feature |
github_copilot_org_loc_added_sum_by_model_feature | model, feature |
Per-user activity
Per-user totals from the users-1-day report. Each metric carries the user identity labels described earlier.
| Metric | What it tracks |
|---|---|
github_copilot_user_loc_suggested_to_add_sum | Lines of code suggested for addition. |
github_copilot_user_loc_suggested_to_delete_sum | Lines of code suggested for deletion. |
github_copilot_user_loc_added_sum | Lines of code added. |
github_copilot_user_loc_deleted_sum | Lines of code deleted. |
github_copilot_user_code_generation_activity_count | Code-generation activities. |
github_copilot_user_code_acceptance_activity_count | Code-acceptance activities. |
github_copilot_user_user_initiated_interaction_count | User-initiated interactions. |
CLI sub-metrics (emitted only for users who used the CLI that day):
| Metric | What it tracks |
|---|---|
github_copilot_user_cli_session_count | CLI sessions. |
github_copilot_user_cli_request_count | CLI requests. |
github_copilot_user_cli_prompt_count | CLI prompts. |
github_copilot_user_cli_output_tokens_sum | CLI output tokens. |
github_copilot_user_cli_prompt_tokens_sum | CLI prompt tokens. |
github_copilot_user_cli_avg_tokens_per_request | Average tokens per CLI request. |
Per-user breakdowns
Per-user totals sliced by dimension. Each metric carries the user identity labels plus the dimension label(s) shown.
| Metric | Extra labels |
|---|---|
github_copilot_user_code_generation_activity_count_by_ide | ide |
github_copilot_user_code_acceptance_activity_count_by_ide | ide |
github_copilot_user_user_initiated_interaction_count_by_ide | ide |
github_copilot_user_loc_suggested_to_add_sum_by_ide | ide |
github_copilot_user_loc_suggested_to_delete_sum_by_ide | ide |
github_copilot_user_loc_added_sum_by_ide | ide |
github_copilot_user_loc_deleted_sum_by_ide | ide |
github_copilot_user_code_generation_activity_count_by_feature | feature |
github_copilot_user_code_acceptance_activity_count_by_feature | feature |
github_copilot_user_user_initiated_interaction_count_by_feature | feature |
github_copilot_user_loc_suggested_to_add_sum_by_feature | feature |
github_copilot_user_loc_suggested_to_delete_sum_by_feature | feature |
github_copilot_user_loc_added_sum_by_feature | feature |
github_copilot_user_loc_deleted_sum_by_feature | feature |
github_copilot_user_code_generation_activity_count_by_language_feature | language, feature |
github_copilot_user_code_acceptance_activity_count_by_language_feature | language, feature |
github_copilot_user_loc_suggested_to_add_sum_by_language_feature | language, feature |
github_copilot_user_loc_suggested_to_delete_sum_by_language_feature | language, feature |
github_copilot_user_loc_added_sum_by_language_feature | language, feature |
github_copilot_user_loc_deleted_sum_by_language_feature | language, feature |
github_copilot_user_user_initiated_interaction_count_by_model_feature | model, feature |
github_copilot_user_code_generation_activity_count_by_model_feature | model, feature |
github_copilot_user_loc_added_sum_by_model_feature | model, feature |
Team membership
A join-table metric whose value is always 1. It exists so you can attribute per-user metrics to teams in queries (a user can appear in several teams, so there is one series per user↔team edge).
| Metric | Labels | Value |
|---|---|---|
github_copilot_user_team_membership | organization, user_login, team_slug, team_id, user_id (when reported) | 1 |
GitHub excludes teams with fewer than five seated Copilot users from the user-teams-1-day report, so github_copilot_user_team_membership has no series for those teams. Their members' per-user activity still arrives (via the users-1-day report), but any team join built on the membership metric will not attribute it to those small teams — team-level totals under-count rather than the activity going missing. See GitHub's team-level metrics reference.
Labels
| Label | On | Meaning |
|---|---|---|
organization | All metrics | The GitHub organization slug. |
user_login | Per-user and membership metrics | The GitHub login. |
user_id | Per-user and membership metrics (when reported) | Stable GitHub user ID — the preferred join key. |
user_email | Per-user metrics (when resolvable) | Organization-verified email. |
user_name | Per-user metrics (when resolvable) | Display name. |
sku | Billing metrics | Billing SKU. |
unit_type | Billing metrics | Billing unit, for example ai-units or requests. |
model | Billing premium-request rows and ..._by_model_feature metrics | Model name. |
ide | ..._by_ide metrics | IDE, for example vscode. |
feature | ..._by_feature, ..._by_language_feature, ..._by_model_feature | Copilot feature, for example code_completion. |
language | ..._by_language_feature metrics | Programming language. |
comment_type | ..._by_comment_type pull-request metrics | Pull-request comment category. |
phase | ..._adoption_phase_* metrics | AI adoption phase. |
team_slug, team_id | github_copilot_user_team_membership | Team identifiers. |
Troubleshooting
The integration was created but no organizations are tracked
This means the Coralogix GitHub App is not installed on any organization your authorization can access, so there is nothing to collect. Install coralogix-copilot-observability on at least one organization on a Copilot plan, then wait for the next daily collection.
No data appears after setup
GitHub publishes a day's report during the following day. The first data point arrives only after the next daily collection runs and GitHub has published the previous day's report. Confirm the Coralogix GitHub App is installed on the organization and that the organization is on a Copilot plan that exposes the metrics API.
Usage or billing metrics are missing
Coralogix collects only what the authorizing user can access. If a plain organization member completed the Authorize step, the integration is created successfully but GitHub returns 403 for the usage and billing APIs, so those metrics never arrive. Re-authorize as an organization admin or billing manager — usage metrics alone can also be collected by a user who has the View organization Copilot metrics permission.
Per-user metrics have no user_email or user_name labels
These labels come from the organization members listing. If the GitHub App installation lacks read access to organization members, collection still succeeds but per-user series carry only user_login (and user_id). Grant members read access to the installation to restore the labels.
A metric is missing for some days
Absent values are skipped, never emitted as 0. If GitHub did not report a field for a day, no series exists for it. Treat a missing series as "not reported," not zero.
CLI session telemetry (Copilot CLI)
GitHub Copilot CLI ships with built-in OpenTelemetry. With a few environment variables it streams its full telemetry — token usage, premium request consumption, model calls, tool invocations, per-turn agent activity, and the Git repository per session — straight to Coralogix's OTLP endpoint. No OpenTelemetry Collector is required.
Supported environments
- Copilot CLI 1.0.41 or newer. Older versions emit a different attribute set.
- macOS and Linux (*nix).
What you need
- A Coralogix Send-Your-Data API key. In Coralogix, navigate to Settings, then API Keys.
- Your Coralogix OTLP endpoint:
ingress.eu2.coralogix.com:443. Use the domain selector at the top of this page to select your region. - Copilot CLI installed on your machine.
giton yourPATH— used to resolve theuser.emailresource attribute.
Set up
-
Install Copilot CLI:
npm install -g @github/copilotcopilot --versionThe first time you run
copilot, it walks you through GitHub authentication. Complete that step before continuing. -
In the shell where you run
copilot, turn on Copilot's OpenTelemetry and point it at Coralogix:export COPILOT_OTEL_ENABLED=trueexport OTEL_EXPORTER_OTLP_ENDPOINT=https://ingress.eu2.coralogix.com:443export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <YOUR_CX_API_KEY>,CX-Application-Name=copilot-cli,CX-Subsystem-Name=<TEAM_NAME>"export OTEL_SERVICE_NAME=github-copilotexport OTEL_RESOURCE_ATTRIBUTES="user.email=$(git config user.email 2>/dev/null || echo "$USER"),cx.integration.source.type=copilot_cli_agent,cx.integration.source.version=1.0.0"export NODE_OPTIONS="--dns-result-order=ipv4first"Variable Why it's needed COPILOT_OTEL_ENABLEDTurns on Copilot's built-in OpenTelemetry. Without it, Copilot emits no telemetry. OTEL_EXPORTER_OTLP_ENDPOINTSends traces and metrics to your Coralogix region's OTLP ingress. OTEL_EXPORTER_OTLP_HEADERSAuthenticates the export (the Bearer key) and routes it — CX-Application-NameandCX-Subsystem-Nameset the Coralogix application and subsystem.OTEL_SERVICE_NAMEResource service.namethe telemetry appears under (github-copilot).OTEL_RESOURCE_ATTRIBUTESAttaches user.email(attributes sessions to a real person) andcx.integration.source.*(routes the data to the AI-session dataset).NODE_OPTIONS--dns-result-order=ipv4first— required on hosts without working IPv6; Copilot's OTLP client tries IPv6 first and does not fall back to IPv4. -
Run Copilot CLI:
copilotCopilot CLI sessions now stream telemetry to Coralogix.
Make it permanent
Add the export lines to ~/.zshrc or ~/.bashrc so every new shell exports them automatically.
Coralogix's ingress has an IPv6 (AAAA) record, and Copilot's OTLP client tries IPv6 first without falling back to IPv4. On a host with no IPv6 route, every export fails with HTTP export failed: network error. NODE_OPTIONS=--dns-result-order=ipv4first makes Node resolve IPv4 first.
Application name and subsystem
Coralogix organizes incoming telemetry by two attributes: Application name and Subsystem. For Copilot CLI, set them in the CX-Application-Name and CX-Subsystem-Name OTLP headers (shown earlier). Use these values:
| Attribute | Suggested value | Why |
|---|---|---|
CX-Application-Name | copilot-cli | Lets you filter dashboards and queries by Copilot CLI specifically. |
CX-Subsystem-Name | The team name — for example, team1, enterprise, data-eng | Lets you filter by team and compare usage across teams. |
With this convention in place, the AI Center Code Agents view for Copilot CLI can be filtered by team from a single dropdown.
Identify the user
The earlier setup sets user.email as a resource attribute (from git config user.email), so CLI sessions attribute to a real person. Copilot CLI also emits enduser.pseudo.id — an anonymous Secure Hash Algorithm (SHA-256) hash, one per CLI installation — on invoke_agent spans only. Child chat and execute_tool spans do not carry it, so pseudonymous per-user queries should target invoke_agent.
Telemetry reference
To explore every span, metric, and span event that GitHub Copilot CLI emits — and use those signals as the basis for your own Custom Dashboards or alerts — see the GitHub Copilot CLI monitoring reference.
Copilot CLI does not emit standalone log records. The information that would normally appear in logs is attached to spans as span events, so the span-event stream is the right place to look for per-turn agent activity.
Repository breakdown
The built-in OpenTelemetry in Copilot CLI reports which repository the session touched. The repository name is available on every invoke_agent span as the attribute github.copilot.git.repository (the GitHub organization is on github.copilot.github.org). AI Center reads this attribute to attribute each session's cost and tokens to the repository it touched, then splits those repositories into Managed and Unmanaged buckets based on repository owner prefixes you configure in Settings, then AI Center, then Code agent. Work that happens outside a repository is reported as unknown.
See the Copilot dashboard Repositories tab to explore repository-level token usage and the split between managed and unmanaged repos.
Classify repositories as Managed or Unmanaged
If you do not configure an Organization, every repository appears as Unmanaged.
For the steps and the full classification rules, see Classify repositories as Managed or Unmanaged.
View in AI Center
After you set up the integration, navigate to AI Center, then Code Agents, then Copilot to see the Copilot dashboard.
The cost shown in the dashboard comes from the month-to-date github_copilot_billing_* gauges that the GitHub App collects. These are the amounts GitHub reports for your organizations' Copilot billing, displayed as-is — so the dashboard reflects real billed usage, not an estimate.
Data scopes
The Copilot dashboards run on metrics and spans (spans provide GitHub Repos and Sessions support). Data scopes restrict which data each user can see — see Code agents observability — Data scopes for the per-agent breakdown.
Next steps
Once your integration is set up, explore Code agents observability to monitor token usage, premium requests, tool calls, and session data across all your coding agents.