> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Copilot

> Point GitHub Copilot's built-in OpenTelemetry exporter at Sazabi to ship Copilot CLI and VS Code agent traces and events — model, token usage, and tool calls, with no prompt text by default.

[All GitHub Copilot integration capabilities](https://docs.sazabi.com/catalogs/integrations/github-copilot)

## About

Ship GitHub Copilot agent telemetry to Sazabi using Copilot's built-in OpenTelemetry exporter. Copilot CLI and VS Code Copilot Chat emit a trace for every agent interaction — the agent invocation, each model call with token usage, and each tool call — and VS Code also emits session, tool-call, turn, and edit-feedback events. Nothing changes in your projects.

Spans are named `invoke_agent`, `chat <model>`, and `execute_tool <tool>` and carry attributes like `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.tool.name`, `gen_ai.conversation.id`, and `github.copilot.nano_aiu`. Prompts, responses, and tool arguments and output are **not** exported unless you turn content capture on.

> [!WARNING]
>
> Content capture attaches prompts, responses, tool arguments and output, and the source code and file paths they contain to every span. Leave it off unless you understand the privacy implications for your team.

## Prerequisites

* Copilot CLI or VS Code with the GitHub Copilot Chat extension
* To configure every developer at once: enterprise owner access and a `.github-private` repository selected as the enterprise's source of client governance ([GitHub's guide](https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/use-managed-settings/get-started))
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL)

## Set up in the dashboard

Pick one path. Enterprise managed settings configure Copilot CLI, VS Code, the GitHub Copilot app, and JetBrains IDEs for every developer whose Copilot license comes from your enterprise, and override local settings. Without enterprise admin access, configure Copilot CLI or VS Code on your own machine.

### Every client (enterprise managed settings)

**Step 1**

### Add the telemetry block to the managed settings

In your enterprise's `.github-private` repository, add this `telemetry` block to `copilot/managed-settings.json` and commit it to the default branch:

```json title="copilot/managed-settings.json" theme={"system"}
{
  "telemetry": {
    "enabled": true,
    "endpoint": "<your intake URL>",
    "protocol": "http/protobuf",
    "capture": {
      "identity": true
    }
  }
}
```

Replace `<your intake URL>` with the intake URL shown above. Pass the bare URL — Copilot appends the signal paths itself.

`capture.identity` adds each developer's GitHub login (`user.name`), operating-system account, and machine name. Set it to `false` to keep telemetry pseudonymous. The highest-precedence managed source supplies the whole `telemetry` object and blocks are never merged, so put every key in the one block that wins, including in team overrides. See GitHub's [`telemetry` reference](https://docs.github.com/en/copilot/reference/enterprise-administrators/enterprise-managed-settings#telemetry).

**Step 2**

### Restart Copilot clients

Clients read managed settings when they start. Developers restart Copilot CLI, and reload VS Code when it prompts, before telemetry begins.

### Copilot CLI on this machine

**Step 1**

### Export the OpenTelemetry variables

Add the following to the shell profile (or launcher script) that starts `copilot`:

```bash title="~/.zshrc" theme={"system"}
export COPILOT_OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT="<your intake URL>"
```

Replace `<your intake URL>` with the intake URL shown above. Leave `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` unset so prompts and tool content stay off. See the [Copilot CLI OpenTelemetry reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#opentelemetry-monitoring).

**Step 2**

### Start a new Copilot CLI session

Environment variables load at startup. Open a new shell and start `copilot`; telemetry begins with that session.

### VS Code Copilot Chat on this machine

**Step 1**

### Turn on OpenTelemetry in VS Code settings

Run **Preferences: Open User Settings (JSON)** from the Command Palette and add:

```json title="settings.json" theme={"system"}
{
  "github.copilot.chat.otel.enabled": true,
  "github.copilot.chat.otel.exporterType": "otlp-http",
  "github.copilot.chat.otel.otlpEndpoint": "<your intake URL>"
}
```

Replace `<your intake URL>` with the intake URL shown above. Keep `github.copilot.chat.otel.captureContent` off. `OTEL_EXPORTER_OTLP_ENDPOINT` and `COPILOT_OTEL_*` environment variables take precedence over these settings. See VS Code's [agent monitoring guide](https://code.visualstudio.com/docs/agents/guides/monitoring-agents).

**Step 2**

### Reload the window

Run **Developer: Reload Window** so Copilot Chat starts exporting.

## Set up with the CLI

You can also register the GitHub Copilot log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create github_copilot --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and point Copilot at it using the configuration shown above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Restart Copilot CLI or reload VS Code and send one prompt to the agent. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm records from the **GitHub Copilot** source appear within a minute or two.

From the CLI, `sazabi logs ask "How many GitHub Copilot log lines arrived in the last 15 minutes?"` confirms rows are arriving, and `sazabi logs ask "Output tokens per gen_ai.request.model for GitHub Copilot in the last hour"` breaks down token counts by model. Copilot CLI reports under service `github-copilot` and VS Code under `copilot-chat`, unless the managed settings set a `serviceName`.

## Troubleshooting

**Nothing arrives** — For Copilot CLI, confirm the exports are present in the shell that started `copilot` (`env | grep -E 'COPILOT_OTEL|OTEL_'`). For VS Code, reload the window. Check that the endpoint is the bare intake URL with no `/v1/...` suffix.

**Managed settings have no effect** — Confirm the `.github-private` repository is selected as your enterprise's source of client governance, the file is `copilot/managed-settings.json` on the default branch, and the developer's Copilot license comes from that enterprise.

**Telemetry goes to another collector** — A higher-precedence managed `telemetry` block (from device management or a local managed-settings file) wins, or, for VS Code, `COPILOT_OTEL_*` or `OTEL_EXPORTER_OTLP_ENDPOINT` environment variables override your settings. Remove or update them.

**Prompt text is showing up** — Content capture is on (`capture.prompts` and related keys, `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT`, or `github.copilot.chat.otel.captureContent`). Turn it off and restart.

**Copilot metrics are stored as log records** — Copilot sends OpenTelemetry metrics on the same endpoint and has no switch to turn them off on their own. Each data point is stored as a log record with `telemetry.type` set to `metric`, not as a time series.

**Copilot cloud agent and code review do not appear** — They run on GitHub and do not export OpenTelemetry. JetBrains IDEs accept the managed `telemetry` setting, but GitHub does not document which signals they export.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.