Skip to content

Monitoring Agent Usage with OpenTelemetry

Ji edited this page May 20, 2026 · 3 revisions

GitHub Copilot for JetBrains IDE supports exporting traces, metrics, and events via OpenTelemetry (OTel) — giving you real-time visibility into agent interactions, LLM calls, tool executions, and token usage.

All signal names and attributes follow the OTel GenAI Semantic Conventions, so the data works with any OTel-compatible backend: Jaeger, Grafana, Azure Monitor, Datadog, Honeycomb, and more.

GitHub Copilot for JetBrains IDE supports OTel with Copilot CLI.

image

Enable OpenTelemetry

OpenTelemetry is off by default. It activates when:

  • COPILOT_OTEL_ENABLED=true, or
  • OTEL_EXPORTER_OTLP_ENDPOINT is set

Environment Variables

You can configure OpenTelemetry with the following environment varilables

Variable Default Description
COPILOT_OTEL_ENABLED false Enable OTel. Also enabled when OTEL_EXPORTER_OTLP_ENDPOINT is set.
COPILOT_OTEL_ENDPOINT OTLP endpoint URL (takes precedence over OTEL_EXPORTER_OTLP_ENDPOINT)
OTEL_EXPORTER_OTLP_ENDPOINT Standard OTel OTLP endpoint URL
OTEL_EXPORTER_OTLP_PROTOCOL http OTLP protocol.
OTEL_SERVICE_NAME copilot-chat Service name in resource attributes
OTEL_RESOURCE_ATTRIBUTES Extra resource attributes (key1=val1,key2=val2)
COPILOT_OTEL_CAPTURE_CONTENT false Capture full prompt/response content
COPILOT_OTEL_LOG_LEVEL info Min log level: trace, debug, info, warn, error
COPILOT_OTEL_FILE_EXPORTER_PATH Write all signals to this file (JSON-lines)
COPILOT_OTEL_HTTP_INSTRUMENTATION false Enable HTTP-level OTel instrumentation
OTEL_EXPORTER_OTLP_HEADERS Auth headers (e.g., Authorization=Bearer token)

Clone this wiki locally