Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ayodejiayodele/3115d60ce7420891d2f005f7395ce99c to your computer and use it in GitHub Desktop.
Save ayodejiayodele/3115d60ce7420891d2f005f7395ce99c to your computer and use it in GitHub Desktop.
Setup Instructions for GitHub Copilot Metrics Power BI Dashboard

Copilot Metrics Dashboard (Power BI Version)

This guide provides step-by-step instructions for deploying the Copilot Metrics Dashboard in your environment.

English | Español |

Setup Instructions

To use this report, ensure you have Power BI Desktop installed or access to the Power BI online service.

This report supports Copilot Business and Copilot Enterprise products, utilizing the GitHub Copilot User Management and Metrics APIs. The Copilot Metrics API became generally available on October 30th, 2024. For more information, read here.

Installing the Power BI App from AppSource

You can install the app from AppSource. Alternatively, search for "GitHub Copilot Metrics" and click on Get it now.

image

The app installation wizard will guide you through the setup process in the Power BI service.

Required Parameters

The report requires the following parameters:

Parameter Description Type Required Default Value
Enterprise Your GitHub Enterprise slug Text True -
OrganizationList Comma-separated list of organizations (preferably < 10). Optional. Leave as empty if not required or just type a null text. Text False null
GitHubAPI The endpoint prefix for the GitHub API Text True https://api.github.com

Authentication

To connect to your GitHub data, authentication and authorization are required. For authentication, select Basic and provide your username and password.

Authentication Details
Type Basic
Username provide your username (GitHub handle)
Password provide your PAT token (read the Authorization section for more details)
Privacy Level Public

Note

Please use Public privacy level. This does not mean your dashboard will be publicly accessible. If you encounter errors during refresh, such as Information is needed in order to combine data. Please specify a privacy level for each data source., try changing the privacy level to Organization or None. Learn more about privacy levels.

Authorization

To read Copilot data, you need to be an organization admin. Create a classic personal access token (PAT) with the following permissions and scopes:

Scope Permissions
admin:org read:org
admin:enterprise read:enterprise, manage_billing:enterprise
copilot manage_billing:copilot

For more information on creating PATs, refer to the GitHub documentation.

Note

The user account from which you are creating the PAT token needs to have access to the API endpoints that the dashboard will be querying. This means read access to the enterprise and read access to each of the organizations that have Copilot seats for the endpoints below.

API Endpoints

Here is a list of the API endpoints that the dashboard makes use of. You need to ensure the token is able to query all these endpoints:

Scope Endpoint
Enterprise Get Copilot metrics for an enterprise
Enterprise List all Copilot seat assignments for an enterprise
Enterprise List enterprise consumed licenses
Enterprise Get GitHub Advanced Security active committers for an enterprise
Organization Get Copilot metrics for an organization (for each org with Copilot seats)

Troubleshooting Tips

Here are some error messages and some troubleshooting tips that may help to solve them.

  • Relationship does not hold any data because it needs to be recalculated

    • Error Message: The expression referenced a relationship between <oii> CopilotEnterpriseStats</oii>[enterprise] and ‹oii>EnterpriseLicenses</oii>|enterprise], which does not hold any data because it needs to be recalculated.
    • Tips to Fix: This may be due to an Enterprise or Organization policy. Ensure that you have enabled the policy for Copilot Metrics API accessat the Enterprise level under Enterprise Settings > Policies > Copilot > Policies image
  • Column x in Table y contains a duplicate value and this is not allowed in many-to-1

    • Error Message: Column <oii >total_seats</oii> in Table <oii>CopilotEnterpriseStats</oii> contains a duplicate value 23 and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.
    • Tips to Fix: It is likely that you are not running the latest version of the app. Upgrade the app from the AppSource.
  • Filtered rows references other queries or steps...Please rebuild this data combination

    • Error Mesage: Data source error{"error":{"code":"ModelRefresh_ShortMessage_ProcessingError","pbi.error":{"code":"ModelRefresh_ShortMessage_ProcessingError","parameters":{},"details":[{"code":"Message","detail":{"type":1,"value":"[Unable to combine data] Section1/PolicyBased_36686F87_B3FA_4760_A613_9C6D47A37170/Filtered Rows references other queries or steps, so it may not directly access a data source. Please rebuild this data combination."}}],"exceptionCulprit":1}}}

    • Tips to Fix: You are likely using a privacy level that prevents the data from one data table to be combined with another. Change the Privacy Level of your authentication credentials to Public.

      image

Getting Help

Visit the GitHub Community (Copilot category) and post your questions to get help.

Comments are disabled for this gist.