Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/agents/guides/monitoring-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Keywords:
- traces
- metrics
- agents
- enterprise
- managed settings
---

# Monitor agent usage with OpenTelemetry
Expand Down Expand Up @@ -245,7 +247,7 @@ Open **Settings** (`kb(workbench.action.openSettings)`) and search for `copilot

### Environment variables

Environment variables always take precedence over VS Code settings.
Environment variables always take precedence over VS Code settings. When your organization mandates OTel configuration through [Copilot managed settings](#manage-otel-configuration-for-your-organization), those managed values take precedence over both environment variables and user settings.

| Variable | Default | Description |
|---|---|---|
Expand All @@ -271,6 +273,15 @@ When `setting(github.copilot.chat.otel.dbSpanExporter.enabled)` is `true`, Copil
|---|---|
| **Chat: Export Agent Traces DB** (`github.copilot.chat.otel.exportAgentTracesDB`) | Export the local SQLite span database to a `.db` file. Only available when the `dbSpanExporter.enabled` setting is `true`. |

## Manage OTel configuration for your organization

Enterprises can mandate OTel export configuration centrally through Copilot managed settings, so that telemetry flows to an approved collector without each developer setting `OTEL_*` environment variables. Managed telemetry configuration applies to both the Copilot Chat extension and the agent host process.

Administrators deliver these settings through the `telemetry` block in Copilot managed settings, using native MDM, a server-managed GitHub account policy, or a `managed-settings.json` file on disk. For the full list of managed telemetry keys, the delivery channels, and important caveats such as secure header handling and reload-to-apply behavior, see [Configure telemetry export with OpenTelemetry](/docs/enterprise/ai-settings.md#configure-telemetry-export-with-opentelemetry).

> [!NOTE]
> When a managed telemetry value is configured, it takes precedence over both environment variables and user settings. The resolved value follows the order: policy, then environment variable, then user setting, then default.

## Trace structure for background and Claude agents

When OTel is enabled, all agent types are automatically instrumented. The same settings that enable foreground agent traces also enable Copilot CLI and Claude agent traces.
Expand Down Expand Up @@ -441,6 +452,7 @@ OTel monitoring is off by default and emits no data until you explicitly enable
## Related content

* [AI settings reference](/docs/agents/reference/ai-settings.md)
* [Manage AI settings in enterprise environments](/docs/enterprise/ai-settings.md)
* [Troubleshoot AI in VS Code](/docs/agents/agent-troubleshooting/troubleshooting.md)
* [OTel GenAI Semantic Conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/)
* [Inside the LLM Call: GenAI Observability with OpenTelemetry](https://opentelemetry.io/blog/2026/genai-observability/)
Expand Down