NOTE: For information on support and assistance, click here.
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. This app utilizes the GitHub Copilot Metrics API.
copilot-metrics-viewer.mov
Here are the key metrics visualized in these charts:
- Acceptance Rate: This metric represents the ratio of accepted lines to the total lines suggested by GitHub Copilot. This rate is an indicator of the relevance and usefulness of Copilot's suggestions.
-
Total Suggestions This chart illustrates the total number of code suggestions made by GitHub Copilot. It offers a view of the tool's activity and its engagement with users over time.
-
Total Acceptances: This visualization focuses on the total number of suggestions accepted by users.
-
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 says, the total lines of code accepted by users (full acceptances) offering insights into how much of the suggested code is actually being utilized incorporated to 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 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 past 28 days. 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 past 28 days. 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 past 28 days.
-
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 past 28 days.
-
Total Assigned: This metric represents the total number of Copilot seats assigned within 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 the .env
file, you can configure several environment variables that control the behavior of the application.
The VUE_APP_SCOPE
environment variable in the .env
file determines the scope of the API calls made by the application. It can be set to either 'enterprise' or 'organization'.
- If set to 'enterprise', the application will target API calls to the GitHub Enterprise account defined in the
VUE_APP_GITHUB_ENT
variable. - If set to 'organization', the application will target API calls to the GitHub Organization account defined in the
VUE_APP_GITHUB_ORG
variable.
For example, if you want to target the API calls to an organization, you would set VUE_APP_SCOPE=organization
in the .env
file.
VUE_APP_SCOPE=organization
VUE_APP_GITHUB_ORG= <YOUR-ORGANIZATION>
VUE_APP_GITHUB_ENT=
The VUE_APP_GITHUB_TEAM
environment variable filters metrics for a specific GitHub team within an Enterprise or Organization account.
VUE_APP_GITHUB_TEAM=
To access Copilot metrics from the last 28 days via the API and display actual data, set the following boolean environment variable to false
:
VUE_APP_MOCKED_DATA=false
Specifies the GitHub Personal Access Token utilized for API requests. Generate this token with the following scopes: copilot, manage_billing:copilot, manage_billing:enterprise, read:enterprise, read:org.
VUE_APP_GITHUB_TOKEN=
npm install
npm run serve
docker build -t copilot-metrics-viewer .
docker run -p 8080:80 --env-file ./.env copilot-metrics-viewer
The application will be accessible at http://localhost:8080
Project can run with an API proxy which hides GitHub tokens and is secure enough to be deployed.
Api Proxy project is in \api
directory. Vue app makes the calls to /api/github
which then are proxied to https://api.github.com
with appropriate bearer token.
Proxy can authenticate user using GitHub App. In order to do that, following environment variables are required:
GITHUB_CLIENT_ID
- client Id of the GitHub App registered and installed in the enterprise/org with permissions listed above.GITHUB_CLIENT_SECRET
- client secret of the GitHub AppSESSION_SECRET
- random string for securing session state
If you want use a custom path for your .env
file you can set the environment variable DOTENV_CONFIG_PATH
.
GitHub_App_Authentication.mp4
It's also possible to run with PAT Token, see examples below for required variables.
For local development register http://localhost:3000/callback
as GH App callback Uri.
For deployed version use the Uri of your app.
To build and run the app with API proxy:
docker build -t copilot-metrics-viewer-with-proxy -f api.Dockerfile .
To run:
docker run -it --rm -p 8080:3000 --env-file ./.env copilot-metrics-viewer-with-proxy
Or with custom path for your .env
file:
docker run -it --rm -p 8080:3000 \
-e DOTENV_CONFIG_PATH=/custom/.env \
-v /path/to/your/.env:/custom/.env \
copilot-metrics-viewer-with-proxy
Proxy can also run with token hardcoded on the backend (which hides it from frontend calls), here's a sample:
docker run -it --rm -p 3000:3000 \
-e VUE_APP_SCOPE=enterprise \
-e VUE_APP_GITHUB_API=/api/github \
-e VUE_APP_GITHUB_ENT=<enterprise name> \
-e VUE_APP_GITHUB_TOKEN=<github PAT> \
-e SESSION_SECRET=<random string> \
copilot-metrics-viewer-with-proxy
or
docker run -it --rm -p 3000:3000 \
-e VUE_APP_SCOPE=organization \
-e VUE_APP_GITHUB_API=/api/github \
-e VUE_APP_GITHUB_ORG=<org name> \
-e VUE_APP_GITHUB_TOKEN=<github PAT> \
-e SESSION_SECRET=<random string> \
copilot-metrics-viewer-with-proxy
This 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) 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. 🙏🏼