GitHub Copilot
GitHub is sunsetting the legacy Copilot Metrics API on April 2, 2026.
- The
copilot-team-metricsresource will stop functioning after this date. - Team-level metrics are not supported in the new GitHub API. Users are advised to migrate to Organization-level metrics using the instructions below.
Port's Github Copilot integration allows you to ingest your Github Copilot usage metrics into your software catalog.
Supported aggregation hierarchies
Some aggregation hierarchies of Github Copilot usage metrics can be ingested into Port, they are listed below.
It is possible to reference any field that appears in the API responses linked below in the mapping configuration.
- organization-usage-metrics (new API) - Recommended
- copilot-organization-metrics (sunset) - Sunsetting April 2026
- copilot-team-metrics (sunset) - Sunsetting April 2026
Setup
Choose one of the following installation methods:
Not sure which method is right for your use case? Check the available installation methods.
- Hosted by Port (Recommended)
- Self-hosted
- CI
-
Go to the Github Copilot data source page in your portal.
-
Under
Select your installation method, chooseHosted by Port. -
Configure the
Installation parametersandAdvanced configurationas you wish (see below for details).
Installation parameters
Each integration requires specific parameters (such as an API token, a URL, etc.), as seen in Port's UI when installing it. Hover over the ⓘ icon next to each parameter to see more details about it.
Advanced configuration
-
During the installation process each integration may have additional settings under the
Advanced configurationsection in Port's UI.
Additionally, each integration has one or more settings that can be configured after installation. To do so, click on the integration's name in the Data sources page and navigate to theSettingtab.
Hover over the ⓘ icon next to each setting to see more details about it. -
If the integration supports live events, the option to enable/disable them will be available in this section.
Currently, live events are not supported for this integration.
Resyncs will be performed periodically (with a configurable interval), or manually triggered by you via Port's UI.Therefore, real-time events (including GitOps) will not be ingested into Port immediately.
Live events support for this integration is WIP and will be supported in the near future.
Port secrets
Some integration settings require sensitive pieces of data, such as tokens. For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.
When filling in such a setting, its value will be obscured (shown as ••••••••).
For each such setting, Port will automatically create a secret in your organization.
To see all secrets in your organization, follow these steps.
Port source IP addresses
When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses. You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:
- Europe (EU):
54.73.167.226,63.33.143.237,54.76.185.219 - United States (US):
3.234.37.33,54.225.172.136,3.225.234.99
Using this installation option means that the integration will be able to update Port in real time using webhooks.
Prerequisites
-
A Kubernetes cluster - the integration's container chart will be deployed to this cluster.
-
kubectlandhelmmust be installed on your machine. YourkubectlCLI must be connected to the Kubernetes cluster where you plan to install the integration.
For details about the available parameters for the installation, see the table below.
- Helm
- ArgoCD
-
Go to the Github Copilot data source page in your portal.
-
Select the
Self-hostedmethod. -
A
helmcommand will be displayed, with default values already filled out (e.g. your Port client ID, client secret, etc). Copy the command, replace the placeholders with your values, then run it in your terminal to install the integration.
BaseUrl & webhook configuration
To enable real-time updates of the data in your software catalog, you need to define the liveEvents.baseUrl parameter.
This parameter should be set to the URL of your Github Copilot integration instance, which needs to have the option to setup webhooks via HTTP requests/receive HTTP requests, so ensure the network is configured accordingly.
- If Github Copilot and the integration are in the same cluster/network: Use an internal URL (e.g., a Kubernetes service DNS name).
For Kubernetes deployments, create a service to expose the integration pod and use the service URL asliveEvents.baseUrl. If both the source system and integration are in the same cluster, an internal ClusterIP service is sufficient. - If Github Copilot is external to the integration's network: The integration must be exposed via an ingress, load balancer, or public URL that Github Copilot can reach.
If liveEvents.baseUrl is not provided, the integration will continue to function correctly. In such a configuration, to retrieve the latest information from the target system, the scheduledResyncInterval parameter has to be set, or a manual resync will need to be triggered through Port's UI.
To test webhooks or live event delivery to your local environment, expose your local pod or service to the internet using ngrok (e.g. ngrok http http://localhost:8000)
Scalable mode for large integrations
If you are deploying the integration at scale and want to decouple the resync process from the live events process (recommended for large or high-throughput environments), you can enable scalable mode by adding the following flags to your Helm install command:
--set workload.kind="CronJob" \
--set workload.cron.resyncTimeoutMinutes=60 \
--set scheduledResyncInterval="'*/60 * * * *'" \
--set liveEvents.worker.enabled=true
The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:
- EU (app.port.io) →
https://api.port.io - US (app.us.port.io) →
https://api.us.port.io
To install the integration using ArgoCD:
- Create a
values.yamlfile inargocd/my-ocean-github-copilot-integrationin your git repository with the content:
Remember to replace the placeholder for GITHUB_TOKEN.
initializePortResources: true
scheduledResyncInterval: 120
integration:
identifier: my-ocean-github-copilot-integration
type: github-copilot
eventListener:
type: POLLING
secrets:
githubToken: GITHUB_TOKEN
- Install the
my-ocean-github-copilot-integrationArgoCD Application by creating the followingmy-ocean-github-copilot-integration.yamlmanifest:
Remember to replace the placeholders for YOUR_PORT_CLIENT_ID YOUR_PORT_CLIENT_SECRET and YOUR_GIT_REPO_URL.
Multiple sources ArgoCD documentation can be found here.
ArgoCD Application
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-ocean-github-copilot-integration
namespace: argocd
spec:
destination:
namespace: my-ocean-github-copilot-integration
server: https://kubernetes.default.svc
project: default
sources:
- repoURL: 'https://port-labs.github.io/helm-charts/'
chart: port-ocean
targetRevision: 0.9.5
helm:
valueFiles:
- $values/argocd/my-ocean-github-copilot-integration/values.yaml
parameters:
- name: port.clientId
value: YOUR_PORT_CLIENT_ID
- name: port.clientSecret
value: YOUR_PORT_CLIENT_SECRET
- name: port.baseUrl
value: https://api.port.io
- repoURL: YOUR_GIT_REPO_URL
targetRevision: main
ref: values
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:
- EU (app.port.io) →
https://api.port.io - US (app.us.port.io) →
https://api.us.port.io
- Apply your application manifest with
kubectl:
kubectl apply -f my-ocean-github-copilot-integration.yaml
This table summarizes the available parameters for the installation.
| Parameter | Description | Example | Required |
|---|---|---|---|
port.clientId | Your port client id | ✅ | |
port.clientSecret | Your port client secret | ✅ | |
port.baseUrl | Your Port API URL - https://api.port.io for EU, https://api.us.port.io for US | ✅ | |
integration.secrets.githubToken | Github token used to query Github api | ✅ | |
integration.config.githubHost | The host of the Github api instance | https://api.github.com | ✅ |
integration.eventListener.type | The event listener type. Read more about event listeners | ✅ | |
integration.type | The integration to be installed | ✅ | |
scheduledResyncInterval | The number of minutes between each resync. When not set the integration will resync for each event listener resync event. Read more about scheduledResyncInterval | ❌ | |
initializePortResources | Default true, When set to true the integration will create default blueprints and the port App config Mapping. | ❌ | |
sendRawDataExamples | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ |
For advanced configuration such as proxies or self-signed certificates, click here.
This workflow/pipeline will run the Github Copilot integration once and then exit, this is useful for scheduled ingestion of data.
- GitHub
- Jenkins
- Azure Devops
- GitLab
Make sure to configure the following Github Secrets:
| Parameter | Description | Example | Required |
|---|---|---|---|
port_client_id | Your Port client id (How to get the credentials) | ✅ | |
port_client_secret | Your Port client secret (How to get the credentials) | ✅ | |
port_base_url | Your Port API URL - https://api.port.io for EU, https://api.us.port.io for US | ✅ | |
config -> githubToken | Github token used to query Github api | ✅ | |
initialize_port_resources | Default true, When set to true the integration will create default blueprints and the port App config Mapping. | ❌ | |
identifier | The identifier of the integration that will be installed | ❌ | |
version | The version of the integration that will be installed | latest | ❌ |
sendRawDataExamples | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | true |
The following example uses the Ocean Sail Github Action to run the Github Copilot integration. For further information about the action, please visit the Ocean Sail Github Action
Here is an example for github-copilot-integration.yml workflow file:
name: Github Copilot Exporter Workflow
on:
workflow_dispatch:
schedule:
- cron: '0 */1 * * *' # Determines the scheduled interval for this workflow. This example runs every hour.
jobs:
run-integration:
runs-on: ubuntu-latest
timeout-minutes: 30 # Set a time limit for the job
steps:
- uses: port-labs/ocean-sail@v1
with:
type: 'github-copilot'
port_client_id: ${{ secrets.OCEAN__PORT__CLIENT_ID }}
port_client_secret: ${{ secrets.OCEAN__PORT__CLIENT_SECRET }}
port_base_url: https://api.port.io
config: |
githubToken: ${{ secrets.OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN }}
Your Jenkins agent should be able to run docker commands.
Make sure to configure the following Jenkins Credentials of Secret Text type:
| Parameter | Description | Example | Required |
|---|---|---|---|
OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN | Github token used to query Github api (Classic token only) | ✅ | |
OCEAN__PORT__CLIENT_ID | Your Port client id (How to get the credentials) | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client secret (How to get the credentials) | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.port.io for EU, https://api.us.port.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ |
Here is an example for Jenkinsfile groovy pipeline file:
pipeline {
agent any
stages {
stage('Run Github Copilot Integration') {
steps {
script {
withCredentials([
string(credentialsId: 'OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN', variable: 'OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN'),
string(credentialsId: 'OCEAN__PORT__CLIENT_ID', variable: 'OCEAN__PORT__CLIENT_ID'),
string(credentialsId: 'OCEAN__PORT__CLIENT_SECRET', variable: 'OCEAN__PORT__CLIENT_SECRET'),
]) {
sh('''
#Set Docker image and run the container
integration_type="github-copilot"
version="latest"
image_name="ghcr.io/port-labs/port-ocean-${integration_type}:${version}"
docker run -i --rm --platform=linux/amd64 \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN=$OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN \
-e OCEAN__PORT__CLIENT_ID=$OCEAN__PORT__CLIENT_ID \
-e OCEAN__PORT__CLIENT_SECRET=$OCEAN__PORT__CLIENT_SECRET \
-e OCEAN__PORT__BASE_URL='https://api.port.io' \
$image_name
exit $?
''')
}
}
}
}
}
}
Prerequisites
- Your Azure Devops agent should be able to run docker commands. Learn more about agents here.
- You must have permissions to create and manage Azure DevOps variable groups for storing credentials.
Set up your credentials
- Create a Variable Group: Name it port-ocean-credentials.
- Store the required variables (see the table below).
- Authorize Your Pipeline:
-
Go to "Library" -> "Variable groups."
-
Find port-ocean-credentials and click on it.
-
Select "Pipeline Permissions" and add your pipeline to the authorized list.
-
| Parameter | Description | Example | Required |
|---|---|---|---|
OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN | Github token used to query Github api (Classic token only) | ✅ | |
OCEAN__PORT__CLIENT_ID | Your Port client id (How to get the credentials) | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client secret (How to get the credentials) | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.port.io for EU, https://api.us.port.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ |
Here is an example for github-copilot-integration.yml pipeline file:
trigger:
- main
pool:
vmImage: "ubuntu-latest"
variables:
- group: port-ocean-credentials
steps:
- script: |
# Set Docker image and run the container
integration_type="github-copilot"
version="latest"
image_name="ghcr.io/port-labs/port-ocean-$integration_type:$version"
docker run -i --rm \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN=$(OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN) \
-e OCEAN__PORT__CLIENT_ID=$(OCEAN__PORT__CLIENT_ID) \
-e OCEAN__PORT__CLIENT_SECRET=$(OCEAN__PORT__CLIENT_SECRET) \
-e OCEAN__PORT__BASE_URL='https://api.port.io' \
$image_name
exit $?
displayName: "Ingest Data into Port"
Make sure to configure the following GitLab variables:
| Parameter | Description | Example | Required |
|---|---|---|---|
OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN | Github token used to query Github api (Classic token only) | ✅ | |
OCEAN__PORT__CLIENT_ID | Your Port client id (How to get the credentials) | ✅ | |
OCEAN__PORT__CLIENT_SECRET | Your Port client secret (How to get the credentials) | ✅ | |
OCEAN__PORT__BASE_URL | Your Port API URL - https://api.port.io for EU, https://api.us.port.io for US | ✅ | |
OCEAN__INITIALIZE_PORT_RESOURCES | Default true, When set to true the integration will create default blueprints and the port App config Mapping. | ❌ | |
OCEAN__INTEGRATION__IDENTIFIER | The identifier of the integration that will be installed | ❌ | |
OCEAN__SEND_RAW_DATA_EXAMPLES | Enable sending raw data examples from the third party API to port for testing and managing the integration mapping. Default is true | ❌ |
Here is an example for .gitlab-ci.yml pipeline file:
default:
image: docker:24.0.5
services:
- docker:24.0.5-dind
before_script:
- docker info
variables:
INTEGRATION_TYPE: github-copilot
VERSION: latest
stages:
- ingest
ingest_data:
stage: ingest
variables:
IMAGE_NAME: ghcr.io/port-labs/port-ocean-$INTEGRATION_TYPE:$VERSION
script:
- |
docker run -i --rm --platform=linux/amd64 \
-e OCEAN__EVENT_LISTENER='{"type":"ONCE"}' \
-e OCEAN__INITIALIZE_PORT_RESOURCES=true \
-e OCEAN__SEND_RAW_DATA_EXAMPLES=true \
-e OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN=$OCEAN__INTEGRATION__CONFIG__GITHUB_TOKEN \
-e OCEAN__PORT__CLIENT_ID=$OCEAN__PORT__CLIENT_ID \
-e OCEAN__PORT__CLIENT_SECRET=$OCEAN__PORT__CLIENT_SECRET \
-e OCEAN__PORT__BASE_URL='https://api.port.io' \
$IMAGE_NAME
rules: # Run only when changes are made to the main branch
- if: '$CI_COMMIT_BRANCH == "main"'
The port_region, port.baseUrl, portBaseUrl, port_base_url and OCEAN__PORT__BASE_URL parameters select which Port API instance to use:
- EU (app.port.io) →
https://api.port.io - US (app.us.port.io) →
https://api.us.port.io
For advanced configuration such as proxies or self-signed certificates, click here.
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: copilot-team-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.__team.slug + "@" + .date)
title: (.__team.slug + " copilot-metrics " + .date)
blueprint: '"github_copilot_usage"'
properties:
record_date: .date + "T00:00:00Z"
breakdown: .
total_suggestions_count: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_suggestions] | map(select(. != null) ) | add'
total_acceptances_count: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_acceptances] | map(select(. != null)) | add'
total_lines_suggested: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_suggested] | map(select(. != null)) | add'
total_lines_accepted: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_accepted] | map(select(. != null)) | add'
total_active_users: .total_active_users
total_chat_acceptances: |-
[
(.copilot_ide_chat.editors[]?.models[]?.total_chat_copy_events // 0),
(.copilot_ide_chat.editors[]?.models[]?.total_chat_insertion_events // 0)
] | map(select(. != null)) | add
total_chat_turns: '[.copilot_ide_chat.editors[]?.models[]?.total_chats // 0] | map(select(. != null)) | add'
total_active_chat_users: '[.copilot_ide_chat.editors[]?.total_engaged_users // 0] | map(select(. != null)) | add'
git_hub_org: .__organization.login
git_hub_team: .__team.slug
- kind: copilot-organization-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.__organization.login + "@" + .date)
title: (.__organization.login + " copilot-metrics " + .date)
blueprint: '"github_copilot_usage"'
properties:
record_date: .date + "T00:00:00Z"
breakdown: .
total_suggestions_count: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_suggestions] | map(select(. != null) ) | add'
total_acceptances_count: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_acceptances] | map(select(. != null)) | add'
total_lines_suggested: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_suggested] | map(select(. != null)) | add'
total_lines_accepted: '[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_accepted] | map(select(. != null)) | add'
total_active_users: .total_active_users
total_chat_acceptances: |-
[
(.copilot_ide_chat.editors[]?.models[]?.total_chat_copy_events // 0),
(.copilot_ide_chat.editors[]?.models[]?.total_chat_insertion_events // 0)
] | map(select(. != null)) | add
total_chat_turns: '[.copilot_ide_chat.editors[]?.models[]?.total_chats // 0] | map(select(. != null)) | add'
total_active_chat_users: '[.copilot_ide_chat.editors[]?.total_engaged_users // 0] | map(select(. != null)) | add'
git_hub_org: .__organization.login
- 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
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
user_initiated_interaction_count: .user_initiated_interaction_count
git_hub_org: .__organization.login
Permissions
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 to be enabled:
manage_billing:copilot.read:org.read:enterprise.
In addition, the Copilot Metrics API access policy must be enabled for the organization within GitHub settings.
Monitoring and sync status
To learn more about how to monitor and check the sync status of your integration, see the relevant documentation.
Examples
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.
GitHub Copilot Usage Blueprint (Sunset) (click to expand)
{
"identifier": "github_copilot_usage",
"title": "GitHub Copilot Usage",
"icon": "Github",
"schema": {
"properties": {
"record_date": {
"type": "string",
"title": "Record Date",
"format": "date-time"
},
"breakdown": {
"type": "object",
"title": "Breakdown"
},
"total_suggestions_count": {
"type": "number",
"title": "Total Suggestions Count"
},
"total_acceptances_count": {
"type": "number",
"title": "Total Acceptances Count"
},
"total_lines_suggested": {
"type": "number",
"title": "Total Lines Suggested"
},
"total_lines_accepted": {
"type": "number",
"title": "Total Lines Accepted"
},
"total_active_users": {
"type": "number",
"title": "Total Active Users"
},
"total_chat_acceptances": {
"type": "number",
"title": "Total Chat Acceptances"
},
"total_chat_turns": {
"type": "number",
"title": "Total Chat Turns"
},
"total_active_chat_users": {
"type": "number",
"title": "Total Active Chat Users"
},
"git_hub_org": {
"type": "string",
"title": "GitHub Org"
},
"git_hub_team": {
"type": "string",
"title": "GitHub Team"
}
},
"required": []
},
"calculationProperties": {
"acceptance_rate": {
"title": "Acceptance Rate",
"icon": "DefaultProperty",
"calculation": "if (.properties.total_suggestions_count == 0) then 0 else ((.properties.total_acceptances_count / .properties.total_suggestions_count) * 100 | round) end",
"type": "number"
}
},
"relations": {}
}
Team hierarchy metrics (sunset - April 2026)
Integration configuration (click to expand)
entityDeletionThreshold: 0
resources:
- kind: copilot-team-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.__team.slug + "@" + .date)
title: (.__team.slug + " copilot-metrics " + .date)
blueprint: '"github_copilot_usage"'
properties:
record_date: .date + "T00:00:00Z"
breakdown: .
total_suggestions_count: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_suggestions]
| map(select(. != null) ) | add
total_acceptances_count: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_acceptances]
| map(select(. != null)) | add
total_lines_suggested: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_suggested]
| map(select(. != null)) | add
total_lines_accepted: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_accepted]
| map(select(. != null)) | add
total_active_users: .total_active_users
total_chat_acceptances: >-
[
(.copilot_ide_chat.editors[]?.models[]?.total_chat_copy_events // 0),
(.copilot_ide_chat.editors[]?.models[]?.total_chat_insertion_events // 0)
]
| map(select(. != null)) | add
total_chat_turns: >-
[.copilot_ide_chat.editors[]?.models[]?.total_chats // 0]
| map(select(. != null)) | add
total_active_chat_users: >-
[.copilot_ide_chat.editors[]?.total_engaged_users // 0]
| map(select(. != null)) | add
git_hub_org: .__organization.login
git_hub_team: .__team.slug
Organization hierarchy metrics (deprecated)
Integration configuration (click to expand)
entityDeletionThreshold: 0
resources:
- kind: copilot-organization-metrics
selector:
query: 'true'
port:
entity:
mappings:
identifier: (.__organization.login + "@" + .date)
title: (.__organization.login + " copilot-metrics " + .date)
blueprint: '"github_copilot_usage"'
properties:
record_date: .date + "T00:00:00Z"
breakdown: .
total_suggestions_count: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_suggestions]
| map(select(. != null) ) | add
total_acceptances_count: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_acceptances]
| map(select(. != null)) | add
total_lines_suggested: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_suggested]
| map(select(. != null)) | add
total_lines_accepted: >-
[.copilot_ide_code_completions.editors[]?.models[]?.languages[]?.total_code_lines_accepted]
| map(select(. != null)) | add
total_active_users: .total_active_users
total_chat_acceptances: >-
[
(.copilot_ide_chat.editors[]?.models[]?.total_chat_copy_events // 0),
(.copilot_ide_chat.editors[]?.models[]?.total_chat_insertion_events // 0)
]
| map(select(. != null)) | add
total_chat_turns: >-
[.copilot_ide_chat.editors[]?.models[]?.total_chats // 0]
| map(select(. != null)) | add
total_active_chat_users: >-
[.copilot_ide_chat.editors[]?.total_engaged_users // 0]
| map(select(. != null)) | add
git_hub_org: .__organization.login
Organization usage metrics
GitHub Copilot Organization Usage Blueprint
{
"identifier": "githubCopilotOrganizationUsage",
"title": "GitHub Copilot Organization Usage",
"icon": "Github",
"schema": {
"properties": {
"record_date": {
"type": "string",
"title": "Record Date",
"format": "date-time"
},
"daily_active_users": {
"type": "number",
"title": "Daily Active Users"
},
"code_generation_activity_count": {
"type": "number",
"title": "Code Generation Activity Count"
},
"code_acceptance_activity_count": {
"type": "number",
"title": "Code Acceptance Activity Count"
},
"loc_suggested_to_add_sum": {
"type": "number",
"title": "LOC Suggested To Add"
},
"loc_added_sum": {
"type": "number",
"title": "LOC Added"
},
"user_initiated_interaction_count": {
"type": "number",
"title": "User Initiated Interaction Count"
},
"git_hub_org": {
"type": "string",
"title": "GitHub Org"
}
},
"required": []
},
"calculationProperties": {
"acceptance_rate": {
"title": "Acceptance Rate",
"icon": "DefaultProperty",
"calculation": "if (.properties.code_generation_activity_count == 0) then 0 else ((.properties.code_acceptance_activity_count / .properties.code_generation_activity_count) * 100 | round) end",
"type": "number"
}
}
}
Integration 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
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
user_initiated_interaction_count: .user_initiated_interaction_count
git_hub_org: .__organization.login