Skip to content

Latest commit

 

History

History
75 lines (45 loc) · 4.81 KB

README.md

File metadata and controls

75 lines (45 loc) · 4.81 KB

Grafana and Copilot Metrics Dashboard

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)

Sample Screenshot

image

How to get started with creating your dashboard!

GitHub

Login and create a Personal access token that will match the permission requirements for the GitHub Copilot API

Save the secret and don't expose it!

Grafana

  • 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
Screenshot 2024-05-02 at 6 45 31 pm
  • Search for 'infinity' and click on the data source
Screenshot 2024-05-02 at 6 45 45 pm
  • Click on Install on the right hand corner. Wait 2 minutes and enjoy ☕
image
  • Click on the left hand menu button in the top left hand corner and navigate to Data Sources
image
  • 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
image
  • 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 and your-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

image

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

Contact Info

Feel free to contact me to discuss any issues, questions, or comments.

My contact info can be found on my GitHub page.