Skip to content

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

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

What you need

  • A Coralogix account with a Send-Your-Data API key. In Coralogix, navigate to Settings, then API Keys.
  • Your Coralogix OTLP endpoint: ingress.: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 below.
  • Copilot CLI installed on your machine.

Why a collector is required

Unlike Claude Code or Gemini CLI, 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

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

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 page and extract otelcol-contrib to your PATH.

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.: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

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

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

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

Application name and subsystem

Coralogix organizes incoming telemetry by two resource attributes: Application name and Subsystem. For Copilot CLI, we recommend:
AttributeRecommended valueWhy
cx.application.namecopilot-cliLets you filter dashboards and queries by Copilot CLI specifically.
cx.subsystem.nameThe team name — for example, team1, enterprise, data-engLets 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 with a single click.

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

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.

Build a custom dashboard

The pre-built Code Agents dashboard in AI Center covers cost, usage, sessions, and tool calls out of the box. To build your own dashboard with the full set of spans, metrics, and span events that Copilot CLI emits, see the GitHub Copilot CLI telemetry reference.

Next steps

Once your integration is set up, explore Code agents observability to monitor token usage, premium requests, tool calls, and session data across all your coding agents.