Repository navigation
Collect copilot telemetry correlation - fixes #57104 - #57106
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🔵 Needs a closer look
The pinned Copilot runtime source returns 404, leaving the core cross-product UUID acceptance, normalization, and hashing contract unconfirmed pending verification by a maintainer with access.
No open issues 🎉
What changed in this PR
Adds Copilot session correlation to .NET SDK telemetry, addressing #57104 so SDK events can be linked to the originating Copilot session.
Changes:
- Captures
COPILOT_AGENT_SESSION_IDper event, preserving recognized UUIDs, hashing other values, and recordingnot_presentwhen absent. - Adds tests for normalization, telemetry opt-out, queued events, and session changes in reused MSBuild hosts.
- Documents the correlation field while preserving existing SDK session IDs and opt-out behavior.
| File | Description |
|---|---|
test/dotnet.Tests/TelemetryTests/TelemetryHostMatrixTests.cs |
Checks correlation across build hosts and reused-server requests. |
test/dotnet.Tests/TelemetryTests/TelemetryClientTests.cs |
Covers normalization, opt-out, and per-event capture. |
src/Common/EnvironmentVariableNames.cs |
Defines the Copilot session environment variable name. |
src/Cli/dotnet/Telemetry/TelemetryClient.cs |
Captures, normalizes, and attaches Copilot correlation to events. |
documentation/project-docs/telemetry.md |
Documents the field, normalization, and missing-value semantics. |
Review effort: Balanced
baronfel
left a comment
There was a problem hiding this comment.
I don't think this is the right approach - this should just get added to the 'telemetry common properties'. The TelemetryClient doesn't actually know anything about the telemetry we send, it's just the sender part of the system. The Common Properties are where we actually collect data to be sent.
Pull request was converted to draft
582b4de to
79f01ac
Compare
…d on suggestion by @baronfel Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
79f01ac to
1dd4c48
Compare
Good point! Moved the logic. The actual invocation stays in client (similar to how s_commonProperties are added) |
Telemetry common-property collection now reads COPILOT_AGENT_SESSION_ID. Explicitly return null in the seeded-session and first-use test fixtures so their strict mocks model commands without Copilot context. Preserve existing assertions and opt-out cases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
This PR has been labeled with
|
Motivation
#57104
tl;dr;: ability to correlate sdk and cpilot telemetry
Implementation
Collect the
COPILOT_AGENT_SESSION_IDfrom env block.Mimick the parsing and hashing logic performed by copilot runtime prior sending to their telemetry backend