GitHub Copilot
Port's Github Copilot integration allows you to ingest your Github Copilot usage metrics into your software catalog.
Prerequisites
GitHub token
Port's GitHub Copilot integration requires a classic GitHub token generated by organization owners or parent enterprise owners and billing managers with at least one of the following scopes enabled:
manage_billing:copilotread:orgread:enterprise
In addition, the Copilot Metrics API access policy must be enabled for the organization within GitHub settings.
Setup
Choose one of the following installation methods: Not sure which method is right for your use case? Check the available installation methods.
Configuration
Port integrations use a YAML mapping block to ingest data from the third-party api into Port.
The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.
Default mapping configuration
This is the default mapping configuration for this integration:
Default mapping configuration (Click to expand)
entityDeletionThreshold: 0
resources:
- kind: organization-usage-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.__organization.login + "@" + .day)
title: (.__organization.login + " copilot-metrics " + .day)
blueprint: '"githubCopilotOrganizationUsage"'
properties:
record_date: .day + "T00:00:00Z"
daily_active_users: .daily_active_users
weekly_active_users: .weekly_active_users
monthly_active_chat_users: .monthly_active_chat_users
monthly_active_agent_users: .monthly_active_agent_users
user_initiated_interaction_count: .user_initiated_interaction_count
code_generation_activity_count: .code_generation_activity_count
code_acceptance_activity_count: .code_acceptance_activity_count
loc_suggested_to_add_sum: .loc_suggested_to_add_sum
loc_added_sum: .loc_added_sum
loc_suggested_to_delete_sum: .loc_suggested_to_delete_sum
loc_deleted_sum: .loc_deleted_sum
prs_created_by_copilot: .pull_requests.total_created_by_copilot
prs_reviewed_by_copilot: .pull_requests.total_reviewed_by_copilot
prs_merged_by_copilot: .pull_requests.total_merged_created_by_copilot
total_copilot_applied_suggestions: .pull_requests.total_copilot_applied_suggestions
git_hub_org: .__organization.login
- kind: user-usage-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.user_login + "@" + .__organization.login + "@" + .day)
title: (.user_login + "@" + .__organization.login + "@" + .day)
blueprint: '"githubCopilotUserUsage"'
properties:
record_date: .day + "T00:00:00Z"
code_generation_activity_count: .code_generation_activity_count
code_acceptance_activity_count: .code_acceptance_activity_count
loc_suggested_to_add_sum: .loc_suggested_to_add_sum
loc_suggested_to_delete_sum: .loc_suggested_to_delete_sum
loc_added_sum: .loc_added_sum
loc_deleted_sum: .loc_deleted_sum
user_initiated_interaction_count: .user_initiated_interaction_count
git_hub_org: .__organization.login
used_agent: .used_agent
used_chat: .used_chat
username: .user_login
Mapping & examples per resource
To view and test the integration's mapping against examples of the third-party API responses, use the jq playground in your data sources page. Find the integration in the list of data sources and click on it to open the playground.
Monitoring and sync status
To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.
Migration Guide
This guide covers the migration from the legacy copilot-organization-metrics kind to the new organization-usage-metrics kind. GitHub shut down the legacy Copilot Metrics API on April 2, 2026.
What changed
- The
copilot-organization-metricskind was replaced byorganization-usage-metrics, which uses a new blueprint (githubCopilotOrganizationUsage) and features a restructured schema. - GitHub discontinued support for team-level metrics. As a result, the
copilot-team-metricskind stopped functioning after the sunset date. There is no replacement for this functionality in the new API or the integration.
Migrate from copilot-organization-metrics
1. Add the new blueprint
Ensure you have the githubCopilotOrganizationUsage blueprint in Port. You can find the blueprint definition in the Organization usage metrics section above.
2. Add the new integration mapping
In your Port data source configuration, add the organization-usage-metrics kind. You can find the full mapping in the organization-usage-metrics resource section above.
3. Verify token permissions
Ensure you are using a classic PAT (fine-grained PATs are not supported) with at least one of the following scopes: manage_billing:copilot or read:enterprise. The token must be generated by an Enterprise Administrator or Billing Manager, or a user with the proper fine-grained permissions to access Copilot metrics. Also confirm that the "Copilot usage metrics" policy is set to Enabled everywhere in your enterprise settings under AI Controls -> Copilot -> Metrics.
4. Remove legacy kinds
Once data is flowing correctly via organization-usage-metrics, remove both copilot-organization-metrics and copilot-team-metrics from your mapping. Note that copilot-team-metrics has no replacement — it is simply being removed.
Entities already ingested under the github_copilot_usage blueprint will not be automatically deleted. A resync will auto-reconcile the environment.