Loading...

Skip to main content

Telemetry Architecture

Data flows from wherever your assistant runs — your machine or a Claude Code cloud session — to a dashboard in a few hops, all over OpenTelemetry.

How it works​

  1. Your assistant emits OpenTelemetry. Each tool sends one or more OTLP/HTTP signals (logs, traces, and/or metrics) describing every AI call — for example Copilot CLI emits spans only (see Data Collected).
  2. The Cloud Run collector receives and normalizes it. A shared OpenTelemetry Collector running on Cloud Run (europe-central2) receives the data, maps each provider's fields onto the common gen_ai.* convention, and also derives gen_ai.calls and gen_ai.duration metrics from spans (via the spanmetrics connector).
  3. It exports to Google Cloud Observability. The collector forwards to telemetry.googleapis.com. Logs land in the project's _Default log bucket; spans land in the _Trace bucket.
  4. Log/Trace buckets are linked into BigQuery. The _Default bucket surfaces as ai_usage_logs._AllLogs and the _Trace bucket as ai_usage_spans._AllSpans.
  5. A central view unifies providers. ai_usage_pii.v_gen_ai_calls is a UNION across the provider branches (Claude Code, Copilot Chat, Codex, Copilot CLI), giving one queryable table of AI calls.
  6. Looker Studio reads the view to render the usage dashboard.

Copilot desktop and CLI attribution​

The macOS Copilot desktop app uses the same telemetry runtime as Copilot CLI. In Aliz's verification with desktop app version 1.0.25, both exported the raw resource attribute service.name=github-copilot. The shared BigQuery view labels those calls copilot-cli, so that dashboard label includes both desktop-app and standalone CLI usage.

The sampled spans contained no client identifier that the view could use to separate them. COPILOT_OTEL_SOURCE_NAME only changed a local log line in the tested runtime; it did not change exported attributes or dashboard attribution. Separating these clients would require Copilot instrumentation to emit a client identifier. Newer runtimes have not been rechecked here; see the original verification.

Retention and network access​

note

BigQuery view definitions live in BigQuery itself, not in the ai-telemetry repo. The raw _Trace bucket has a 30-day retention, but telemetry used for dashboard reporting is retained before raw trace expiry. The dashboard's historical data is therefore not limited to 30 days. Only direct queries against the raw _Trace bucket have that lookback limit.

For a locked-down network, an optional local Docker relay can sit between the assistant and the Cloud Run collector; see the ai-telemetry repo.