In a previous post I showed how to send the GitHub Copilot OpenTelemetry data to the Aspire Dashboard. Great for "what just happened on my machine?", but the data is gone when the container stops. And nobody else on the team can see it.
So, the question becomes: how do we get the same data into Application Insights?
There are two possible routes we can try: through an OpenTelemetry Collector, or directly to the OTLP endpoint of Application Insights.
In this post we focus on the OpenTelemetry Collector. This is probably the easiest one and the one you’ll find in the documentation.
We’ll put an OpenTelemetry Collector between Copilot Chat and Application Insights:
VS Code Copilot Chat
│ OTLP/HTTP
▼
OpenTelemetry Collector
│ Azure Monitor exporter
▼
Application Insights
The collector receives standard OpenTelemetry data and forwards it using the Application Insights connection string.
Create an Application Insights resource
Create an Application Insights resource in Azure, then copy its connection string from the resource’s Overview page.
You’ll also need Docker and VS Code with Copilot Chat.
Configure the collector
Create a file called otel-collector-config.yaml:
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
processors:
batch:
exporters:
azuremonitor:
connection_string: ${env:APPLICATIONINSIGHTS_CONNECTION_STRING}
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [azuremonitor]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [azuremonitor]
logs:
receivers: [otlp]
processors: [batch]
exporters: [azuremonitor]
We need the contrib collector distribution because it includes the Azure Monitor exporter. The exporter maps OpenTelemetry spans, metrics, and logs into Application Insights telemetry.
Start it from PowerShell:
$env:APPLICATIONINSIGHTS_CONNECTION_STRING = "<your-connection-string>"
docker run --rm --name copilot-otel-collector `
-p 127.0.0.1:4318:4318 `
-e APPLICATIONINSIGHTS_CONNECTION_STRING `
-v "${PWD}\otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro" `
otel/opentelemetry-collector-contrib:latest
The receiver listens inside the container, but the Docker port is bound only to your machine’s loopback interface. Don’t expose an unauthenticated collector to your network!
Remark: This example assumes connection-string ingestion is allowed for your Application Insights resource. If your organization requires Entra-only ingestion, use an appropriately authenticated exporter configuration instead.
Point Copilot Chat at the collector
In VS Code, update settings.json:
{ "github.copilot.chat.otel.enabled": true, "github.copilot.chat.otel.exporterType": "otlp-http", "github.copilot.chat.otel.otlpEndpoint": "http://localhost:4318", "github.copilot.chat.otel.captureContent": true
}
Reload the VS Code window and start a Copilot Chat interaction.
Notice that I've enabled content capture. Our data is going to a persistent cloud service. Prompt and response content, tool arguments, and file contents can contain sensitive information. So disable it, if you want to avoid this.
Environment variables and enterprise-managed settings can override these settings, so check those if telemetry goes somewhere unexpected.
Find the data
Open your Application Insights resource and select Logs. For the collector’s Azure Monitor exporter, Copilot’s internal and client spans generally appear as dependencies:
dependencies
| where timestamp > ago(24h)
| where cloud_RoleName == "copilot-chat"
| project timestamp, name, duration, success, operation_Id
| order by timestamp desc
You can then investigate individual operations and their related spans. Log records go to traces, while metrics from this exporter go to customMetrics.
Give ingestion a little time. If nothing appears, check the collector’s console output, the connection string, and whether VS Code inherited an overriding OTEL endpoint.
View the data
There is also an easier option, as you can use one of the built-in Grafana dashboards. Dashboards exist for multiple coding agents but we'll use the one for GitHub Copilot.
Just click on the dashboard link and select the correct App Insights resource:
You can see information about operations, input/output tokens, chat sessions, tool calls, response time and time to first token (TTFT) by model

