GitHub Copilot Source
The Sumo Logic source for GitHub Copilot is a Cloud-to-Cloud (C2C) integration that collects daily Copilot usage metrics from the GitHub Copilot usage metrics API and sends them to Sumo Logic. Use it to analyze Copilot adoption, usage, and activity across your organization.
GitHub is a web-based platform that uses Git for version control and enables developers to manage code repositories, track changes, and collaborate through features such as branches, pull requests, and issue tracking. GitHub Copilot is an AI-powered coding assistant that provides code suggestions, explanations, and code generation to improve developer productivity and code quality.
Data collected
| Description | Polling interval | |
|---|---|---|
| Organization Metrics | Aggregated Copilot usage data for the organization for a specific day, including usage statistics for Copilot features, user engagement data, and feature adoption metrics. | 24 hours |
| User Metrics | (Optional, enabled with Collect User Metrics) User-level Copilot usage data for the organization for a specific day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. | 24 hours |
| User Team Metrics | (Optional, enabled with Collect User Teams) User-team membership data for Copilot across the organization, with one entry per user-team pair. Join this data with the User Metrics to compute team-level usage metrics. | 24 hours |
Setup
Vendor configuration
You need to provide the Organization Name and a PAT Token to configure the GitHub Copilot source.
- Organization Name: Name of the GitHub organization. The name is not case sensitive.
- PAT Token: A fine-grained personal access token (PAT) for the account. To generate one, follow the steps in the GitHub documentation. We recommend configuring a never-expiring fine-grained token for a smooth integration.
Prerequisites
- The fine-grained PAT needs the "Organization Copilot metrics" organization permission (read).
- The Copilot usage metrics API access policy needs to be enabled for the organization.
- Only organization owners and authorized users with the fine-grained "View Organization Copilot Metrics" permission can retrieve Copilot metrics reports for the organization.
- If you use a personal access token (classic) instead, it needs the
read:orgscope. - Refer to the GitHub documentation for the organization, user, and user-team reports for further details.
- If you use a personal access token (classic) instead, it needs the
Source configuration
When you create a GitHub Copilot source, you add it to a Hosted Collector. Before creating the source, identify the Hosted Collector you want to use or create a new Hosted Collector. For instructions, see Configure a Hosted Collector and Source.
To configure a GitHub Copilot source, follow the steps below:
- New UI. In the Sumo Logic main menu select Data Management, and then under Data Collection select Collection. You can also click the Go To... menu at the top of the screen and select Collection.
Classic UI. In the main Sumo Logic menu, select Manage Data > Collection > Collection. - On the Collection page, click Add Source next to a Hosted Collector.
- Search for and select Github Copilot.
- Enter a Name for the source. The description is optional.
- (Optional) For Source Category, enter any string to tag the output collected from the source. Category metadata is stored in a searchable field called
_sourceCategory. - (Optional) Fields. Click the +Add button to define the fields you want to associate. Each field needs a name (key) and value.
A green circle with a check mark is shown when the field exists and is enabled in the Fields table schema.
An orange triangle with an exclamation point is shown when the field doesn't exist in the Fields table schema. In this case, you'll see an option to automatically add or enable the nonexistent fields to the Fields table schema. If a field is sent to Sumo Logic that does not exist in the Fields schema it is ignored, known as dropped.
- (Optional) Base URL. Base URL of the GitHub REST API. The default value is
https://api.github.com. Change it only if your GitHub organization is accessed through a different API base URL. - Organization Name. Name of the GitHub organization. The name is not case sensitive.
- PAT Token. Enter the PAT generated from GitHub, as described in Vendor configuration.
- (Optional) Collect User Teams. Select this check box to collect the Copilot user team report, which contains the team memberships of the users in your organization.
- (Optional) Collect User Metrics. Select this check box to collect the daily Copilot usage metrics of each user in your organization.
- Metrics Aggregation Period (in days). Specifies the number of past days for which to collect metrics data. The range is 1 to 28 days, and the default is 1 day. You can adjust it based on your needs.
- (Optional) Processing Rules for Logs. Expand the section to add filters that exclude, include, hash, or mask log messages that match a regular expression.
- When you are finished configuring the source, click Save.
After configuring the GitHub Copilot source, consider installing the Sumo Logic app for GitHub Copilot to visualize and analyze the collected data using prebuilt dashboards and monitor alerts.
JSON schema
Sources can be configured using UTF-8 encoded JSON files with the Collector Management API. See Use JSON to Configure Sources for more details.
| Parameter | Type | Value | Required | Description |
|---|---|---|---|---|
| schemaRef | JSON Object | {"type":"Github Copilot"} | Yes | Define the specific schema type. |
| sourceType | String | "Universal" | Yes | Type of source. |
| config | JSON Object | Configuration object | Yes | Source type specific values. |
Configuration object
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| name | String | Yes | null | Type a desired name of the source. The name must be unique per Collector. This value is assigned to the metadata field _source. | "mySource" |
| description | String | No | null | Type a description of the source. | "Testing source" |
| category | String | No | null | Type a category of the source. This value is assigned to the metadata field _sourceCategory. See best practices for details. | "mySource/test" |
| fields | JSON Object | No | null | JSON map of key-value fields (metadata) to apply to the collector or source. Use the boolean field _siemForward to enable forwarding to SIEM. | {"_siemForward": false, "fieldA": "valueA"} |
| baseURL | String | No | "https://api.github.com" | Base URL of the GitHub REST API. Must begin with https://. | https://api.github.com |
| filters | JSON Array | No | null | Processing rules (filters) to apply to the collected logs. Each filter requires a name, a regular expression (regexp), and a filterType (Exclude, Include, Hash, or Mask). | [{"name": "filter1", "regexp": ".*test.*", "filterType": "Exclude"}] |
| organization | String | Yes | null | Name of your GitHub organization. | sanlabs |
| patToken | String | Yes | null | PAT of the account. | github_pat_xxxz7ARP6EABxxxxxxx |
| collectUserTeamReport | Boolean | No | false | Specify whether to collect the user team report (the team memberships of the users in your organization). | true |
| collectUserMetrics | Boolean | No | false | Specify whether to collect the daily Copilot usage metrics of each user in your organization. | true |
| metricPeriodInDays | Integer | Yes | 1 | Specifies the number of past days for which to collect metrics data. Range 1-28. | 2 |
JSON example
loading...
Terraform example
loading...
Limitations
GitHub returns an HTTP 204 status (no content) when the API call requests data for the current day. Data for a given day is available only after 24 hours.
FAQ
Click here for more information about Cloud-to-Cloud sources.