Skip to content

Commit 61c0139

Browse files
rchiodoCopilot
andauthored
Add GDPR declaration for pyrefly.detection telemetry event (microsoft#26053)
## Summary Adds a `__GDPR__` declaration for the Pylance `pyrefly.detection` telemetry event so it is allow-listed and reaches the telemetry pipeline. ## Background Pylance emits a `PYREFLY.DETECTION` event (sent through the `ms-python.python` reporter as `ms-python.python/pyrefly.detection`) during background Pyrefly detection, to measure the addressable audience that could be offered a switch to Pyrefly. The event shipped in Pylance `2026.2.109` (pre-release) and `2026.3.1` (stable) and fires unconditionally on the **same** reporter as `language_server.ready`. Despite millions of users on those builds emitting the sibling `language_server.ready` event, `pyrefly.detection` showed **zero** rows in telemetry. Root cause: the new event name was not declared in this GDPR allow-list, so it was scrubbed before ingestion. `language_server.ready` is declared here and flows fine; `pyrefly.detection` was missing. ## Change Declares `pyrefly.detection` with its properties: - `available`, `haspyreflytoml`, `haspyprojectsection`, `hasenvironmentbinary`, `promptdismissed`, `notificationenabled` — the event-specific fields emitted by Pylance's `_reportDetectionTelemetry`. - `lsversion`, `failed` — common properties, mirroring the sibling `language_server.ready` declaration. All properties are `SystemMetaData` / non-personal (booleans and the LS version). ## Impact No runtime code change. Once a Python extension build containing this declaration reaches users, data will begin flowing from already-deployed Pylance clients that are already emitting the event. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f8281f4 commit 61c0139

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/client/telemetry/pylance.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,20 @@
490490
"failed" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
491491
}
492492
*/
493+
/**
494+
* Telemetry event sent during background Pyrefly detection to measure the audience that could be
495+
* offered a switch to Pyrefly. Reported once per workspace folder (per availability) for users who
496+
* are not already on a Pyrefly diagnostics source.
497+
*/
498+
/* __GDPR__
499+
"pyrefly.detection" : {
500+
"available" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
501+
"haspyreflytoml" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
502+
"haspyprojectsection" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
503+
"hasenvironmentbinary" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
504+
"promptdismissed" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
505+
"notificationenabled" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
506+
"lsversion" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "rchiodo" },
507+
"failed" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "owner": "rchiodo" }
508+
}
509+
*/

0 commit comments

Comments
 (0)