This is a personal project where I've developed a sample dashboard in Grafana Cloud to help teams and companies visualise GitHub copilot metrics within Grafana via the Copilot API. Feel free to make suggestions in the Issues tab and get in contact via Contact Info
TLDR; I queried the json response from the Copilot API endpoint and used Grafana to massage the data.
As the Copilot endpoint data is only relevant for 28 days. You can use Recorded Queries to store the API response in the Grafana Cloud hosted prometheus(Only available in cloud + Grafana Enterprise self hosted)
Login and create a Personal access token that will match the permission requirements for the GitHub Copilot API
- Click here for Enterprises Copilot API Endpoints requirements
- Click here for Organisation Copilot API Endpoints requirements
Save the secret and don't expose it!
- Sign up for a free Grafana Cloud account. You can have up to 3 free users!
- Follow the prompts and add your own cloud stack. Your Grafana Cloud stack URL should be XXXXXX.grafana.net
- Wait a couple of minutes and get ☕ or 🍵
- Navigate to your cloud stack URL and welcome to Grafana Cloud!!
- On the left hand side of the screen, go to the Add new connection button
- Search for 'infinity' and click on the data source
- Click on Install on the right hand corner. Wait 2 minutes and enjoy ☕
- Click on the left hand menu button in the top left hand corner and navigate to Data Sources
- Click on add new Data Source
- Type in Infinity in the search bar and click on the infinity result. You should be at this page
-
Rename your data source name to whatever you like. Ideally 'GitHub Copilot'
-
Click on the default flag to turn it on(optional)
-
Go to the Authentication tab and paste your GitHub token in Bearer Token
-
Add 'https://api.github.com' as allowed hosts
-
Click Save and Test
-
Open copilotsample.json file and replace all occurences of
your-org
andyour-enterprise
with your GitHub organisation and enterprise name -
Navigate to the left hand menu ---> Dashboards ---> New ----> Import
-
Paste the contents of copilotsample.json into the screen. Alternatively, upload the whole file
-
Select the Data source you created earlier
-
VOILA! Your dashboard is here
Note: If you haven't updated your-org
and your-enterprise
with your GitHub organisation and enterprise name earlier, you'll need to change the URL of each panel to the relevant API endpoints above. Do this by going to the top right hand corner of each Panel --> Edit --> change URL... or follow the instructions under the JSON template edit subheading
Metrics ideas obtained from https://resources.github.com/learn/pathways/copilot/essentials/measuring-the-impact-of-github-copilot/
Shoutout to @andrekolodochka and @benksmillie for the ideas
Feel free to contact me to discuss any issues, questions, or comments.
My contact info can be found on my GitHub page.