Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fintegrations%2Fai-observability%2Fcopilot-cli.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fintegrations%2Fai-observability%2Fcopilot-cli.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Copilot CLI integration with Coralogix

GitHub Copilot CLI ships with built-in OpenTelemetry support, which means you can send its full telemetry — token usage, premium request consumption, model calls, tool invocations, and per-turn agent activity — to Coralogix. Once connected, every Copilot CLI session in your organization streams live data to a dedicated dashboard, giving you cost visibility, usage patterns, and per-user activity in one place.

## Supported environments[​](#supported-environments "Direct link to Supported environments")

* Copilot CLI 1.0.41 or newer. Older versions emit a different attribute set.
* OS: macOS, Linux (\*nix)

## What you need[​](#what-you-need "Direct link to What you need")

* A Coralogix account with a **Send-Your-Data [API key](https://docs-docusaurus.kinsta.page/user-guides/account-management/api-keys/send-your-data-api-key/.md)**. In Coralogix, navigate to **Settings**, then **API Keys**.
* Your Coralogix OTLP endpoint: `ingress.eu2.coralogix.com:443`. Use the domain selector at the top of this page to select your region.
* A local OpenTelemetry Collector (`otelcol-contrib`). See [Why a collector is required](#why-a-collector-is-required) below.
* Copilot CLI installed on your machine.

## Why a collector is required[​](#why-a-collector-is-required "Direct link to Why a collector is required")

Unlike Claude Code, Copilot CLI cannot push telemetry directly to Coralogix today. Its exporter emits OTLP/JSON, and Coralogix's gRPC ingress accepts OTLP/protobuf. You run a local OpenTelemetry Collector in front of the agent to convert the protocol.

## Set up[​](#set-up "Direct link to Set up")

### Install Copilot CLI[​](#install-copilot-cli "Direct link to Install Copilot CLI")

```
npm install -g @github/copilot

copilot --version
```

The first time you run `copilot`, it walks you through GitHub authentication. Complete that step before continuing.

### Install the OpenTelemetry Collector[​](#install-the-opentelemetry-collector "Direct link to Install the OpenTelemetry Collector")

You need the **contrib** distribution because it includes the `deltatocumulative` processor.

**macOS:**

```
brew install opentelemetry-collector-contrib
```

**Linux:** download the `otelcol-contrib_<version>_linux_amd64.tar.gz` binary from the [OpenTelemetry Collector releases](https://github.com/open-telemetry/opentelemetry-collector-releases/releases) page and extract `otelcol-contrib` to your `PATH`.

### Configure the collector[​](#configure-the-collector "Direct link to Configure the collector")

Save the following to `~/.config/otelcol-coralogix.yaml`:

```
receivers:

  otlp:

    protocols:

      http:

        endpoint: 127.0.0.1:14318

processors:

  batch:

    timeout: 1s

  deltatocumulative:

    max_streams: 1000

    max_stale: 5m

exporters:

  otlphttp/coralogix:

    endpoint: https://ingress.eu2.coralogix.com:443

    encoding: proto

    headers:

      Authorization: "Bearer <YOUR_CX_API_KEY>"

      CX-Application-Name: "copilot-cli"

      CX-Subsystem-Name: "<TEAM_NAME>"

service:

  pipelines:

    traces:

      receivers: [otlp]

      processors: [batch]

      exporters: [otlphttp/coralogix]

    metrics:

      receivers: [otlp]

      processors: [deltatocumulative, batch]

      exporters: [otlphttp/coralogix]
```

Replace the placeholders with your Coralogix region, API key, and team name.

### Start the collector[​](#start-the-collector "Direct link to Start the collector")

```
nohup otelcol-contrib --config ~/.config/otelcol-coralogix.yaml > /tmp/otelcol.log 2>&1 &

echo $! > /tmp/otelcol.pid
```

Verify the collector started cleanly:

```
tail -5 /tmp/otelcol.log

# expect: "Everything is ready. Begin running and processing data."
```

To stop the collector later:

```
kill $(cat /tmp/otelcol.pid)
```

### Point Copilot CLI at the collector[​](#point-copilot-cli-at-the-collector "Direct link to Point Copilot CLI at the collector")

In the shell where you run `copilot`:

```
export OTEL_EXPORTER_OTLP_ENDPOINT='http://127.0.0.1:14318'

export OTEL_SERVICE_NAME='github-copilot'

export OTEL_RESOURCE_ATTRIBUTES='cx.application.name=copilot-cli,cx.subsystem.name=<TEAM_NAME>'
```

Run Copilot CLI:

```
copilot
```

Copilot CLI sessions now stream telemetry to Coralogix.

### Make it permanent[​](#make-it-permanent "Direct link to Make it permanent")

Add the three `export` lines to `~/.zshrc` or `~/.bashrc` so every new shell exports them automatically.

## Application name and subsystem[​](#application-name-and-subsystem "Direct link to Application name and subsystem")

Coralogix organizes incoming telemetry by two resource attributes: **Application name** and **Subsystem**. For Copilot CLI, we recommend:

| Attribute             | Recommended value                                              | Why                                                                 |
| --------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------- |
| `cx.application.name` | `copilot-cli`                                                  | Lets you filter dashboards and queries by Copilot CLI specifically. |
| `cx.subsystem.name`   | The team name — for example, `team1`, `enterprise`, `data-eng` | Lets you filter by team and compare usage across teams.             |

These values are set both as `OTEL_RESOURCE_ATTRIBUTES` on Copilot CLI **and** as `CX-Application-Name` and `CX-Subsystem-Name` headers on the collector. The collector's headers are authoritative — keep them in sync with what you set on the agent so spans group correctly.

With this convention in place, the AI Center Code Agents dashboard for Copilot CLI can be filtered by team from a single dropdown.

## View in AI Center[​](#view-in-ai-center "Direct link to View in AI Center")

Once your Copilot CLI sessions are streaming telemetry, navigate to **AI Center**, then **Code Agents**, then **Copilot CLI** to see the dedicated dashboard. The **Application/Subsystem** dropdown lists every `<application> – <subsystem>` pair you configured (for example, `copilot-cli – team1`, `copilot-cli – team2`), so you can slice premium request usage, sessions, token data, and tool calls by team.

## Identify the user[​](#identify-the-user "Direct link to Identify the user")

Copilot CLI does not emit `user.email`. It emits `enduser.pseudo.id` — an anonymous SHA-256 hash, one per CLI installation — on `invoke_agent` spans only. Child `chat` and `execute_tool` spans do not carry it. Per-user queries should always target `invoke_agent`.

## Data scopes[​](#data-scopes "Direct link to Data scopes")

The Copilot CLI dashboard runs on metrics. Support for [data scopes](https://docs-docusaurus.kinsta.page/user-guides/account-management/user-management/scopes/.md) on Copilot CLI metrics is **forthcoming**. See [Code agents observability — Data scopes](https://docs-docusaurus.kinsta.page/user-guides/ai/code-agents/.md#data-scopes) for the per-agent breakdown.

## Telemetry reference[​](#telemetry-reference "Direct link to Telemetry reference")

The AI Center Code Agents dashboard surfaces the most common cost, usage, and activity signals out of the box. To explore every span, metric, and span event that GitHub Copilot CLI emits — and use those signals as the basis for your own Custom Dashboards or alerts — see the [GitHub Copilot CLI monitoring reference](https://code.visualstudio.com/docs/copilot/guides/monitoring-agents).

Copilot CLI does not emit standalone log records. The information that would normally appear in logs is attached to spans as span events, so the span-event stream is the right place to look for per-turn agent activity.

## Next steps[​](#next-steps "Direct link to Next steps")

Once your integration is set up, explore [Code Agents Intelligence](https://docs-docusaurus.kinsta.page/user-guides/ai/code-agents/.md) to monitor token usage, premium requests, tool calls, and session data across all your coding agents.
