Skip to content

Commit e4274f3

Browse files
committed
update
1 parent 4a21bf8 commit e4274f3

2 files changed

Lines changed: 44 additions & 14 deletions

File tree

analysis/kusto/00-telemetry-validation.kql

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RawEventsVSCodeExt
1717
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtensionVersion)), _patch = tolong(extract("^1\\.\\d+\\.(\\d+)", 1, ExtensionVersion))
1818
| where _minor > 23 or (_minor == 23 and _patch >= 10781012)
1919
| summarize UniqueMachines = dcount(VSCodeMachineId) by ExtensionVersion
20-
| order by ExtensionVersion desc;
20+
| order by UniqueMachines desc;
2121

2222

2323
// =============================================================================
@@ -131,6 +131,16 @@ RawEventsVSCodeExt
131131
EventCount = count(),
132132
UniqueMachines = dcount(VSCodeMachineId)
133133
by ManagerName = tostring(Properties.managername), ErrorType = tostring(Properties.errortype)
134+
| extend TotalUniqueMachines = toscalar(
135+
RawEventsVSCodeExt
136+
| where ServerTimestamp > ago(7d)
137+
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
138+
| extend ExtVersion = tostring(Properties["common.extversion"])
139+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion)), _patch = tolong(extract("^1\\.\\d+\\.(\\d+)", 1, ExtVersion))
140+
| where _minor > 23 or (_minor == 23 and _patch >= 10781012)
141+
| summarize dcount(VSCodeMachineId)
142+
)
143+
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalUniqueMachines) * 100, 1)
134144
| order by EventCount desc;
135145

136146

@@ -149,21 +159,43 @@ RawEventsVSCodeExt
149159
EventCount = count(),
150160
UniqueMachines = dcount(VSCodeMachineId)
151161
by FailureStage = tostring(Properties.failurestage)
162+
| extend TotalUniqueMachines = toscalar(
163+
RawEventsVSCodeExt
164+
| where ServerTimestamp > ago(7d)
165+
| where EventName == "ms-python.vscode-python-envs/setup.hang_detected"
166+
| extend ExtVersion = tostring(Properties["common.extversion"])
167+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion)), _patch = tolong(extract("^1\\.\\d+\\.(\\d+)", 1, ExtVersion))
168+
| where _minor > 23 or (_minor == 23 and _patch >= 10781012)
169+
| summarize dcount(VSCodeMachineId)
170+
)
171+
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalUniqueMachines) * 100, 1)
152172
| order by EventCount desc;
153173

154174

155175
// =============================================================================
156-
// CHECK 6: Sanity ratio — skipped + registered should roughly add up
157-
// For each manager that can be skipped, compare skipped count to registered count.
176+
// CHECK 6: Registered vs Skipped — unique machine counts per manager
177+
// For each manager that can be skipped, compare registered vs skipped machine counts.
158178
// If a manager shows 0 registered AND 0 skipped, the telemetry path may be broken.
159179
// =============================================================================
180+
let totalMachines = toscalar(
181+
RawEventsVSCodeExt
182+
| where ServerTimestamp > ago(7d)
183+
| where EventName in (
184+
"ms-python.vscode-python-envs/manager_registration.skipped",
185+
"ms-python.vscode-python-envs/environment_manager.registered"
186+
)
187+
| extend ExtVersion = tostring(Properties["common.extversion"])
188+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion)), _patch = tolong(extract("^1\\.\\d+\\.(\\d+)", 1, ExtVersion))
189+
| where _minor > 23 or (_minor == 23 and _patch >= 10781012)
190+
| summarize dcount(VSCodeMachineId)
191+
);
160192
let skipped = RawEventsVSCodeExt
161193
| where ServerTimestamp > ago(7d)
162194
| where EventName == "ms-python.vscode-python-envs/manager_registration.skipped"
163195
| extend ExtVersion = tostring(Properties["common.extversion"])
164196
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion)), _patch = tolong(extract("^1\\.\\d+\\.(\\d+)", 1, ExtVersion))
165197
| where _minor > 23 or (_minor == 23 and _patch >= 10781012)
166-
| summarize Skipped = dcount(VSCodeMachineId) by Manager = tostring(Properties.managername);
198+
| summarize SkippedMachines = dcount(VSCodeMachineId) by Manager = tostring(Properties.managername);
167199
let registered = RawEventsVSCodeExt
168200
| where ServerTimestamp > ago(7d)
169201
| where EventName == "ms-python.vscode-python-envs/environment_manager.registered"
@@ -178,21 +210,17 @@ let registered = RawEventsVSCodeExt
178210
RawManagerId has "pipenv", "pipenv",
179211
RawManagerId has "poetry", "poetry",
180212
RawManagerId)
181-
| summarize Registered = dcount(VSCodeMachineId) by Manager;
213+
| summarize RegisteredMachines = dcount(VSCodeMachineId) by Manager;
182214
skipped
183215
| join kind=fullouter registered on Manager
184216
| project
185217
Manager = coalesce(Manager, Manager1),
186-
Registered = coalesce(Registered, 0),
187-
Skipped = coalesce(Skipped, 0)
218+
RegisteredMachines = coalesce(RegisteredMachines, 0),
219+
SkippedMachines = coalesce(SkippedMachines, 0),
220+
TotalUniqueMachines = totalMachines
188221
| extend
189-
Total = Registered + Skipped,
190-
Status = case(
191-
Registered + Skipped == 0, "⚠️ NO DATA — check telemetry path",
192-
Registered == 0, "ℹ️ All skipped (tool not installed by anyone?)",
193-
Skipped == 0, "ℹ️ All registered (everyone has this tool?)",
194-
"✅ Mix of registered + skipped — looks correct"
195-
)
222+
RegisteredPct = round(todouble(RegisteredMachines) / todouble(TotalUniqueMachines) * 100, 1),
223+
SkippedPct = round(todouble(SkippedMachines) / todouble(TotalUniqueMachines) * 100, 1)
196224
| order by Manager asc;
197225

198226

analysis/kusto/dashboard.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
" try:\n",
6262
" df = run_kql(client, query)\n",
6363
" display(df)\n",
64+
" if \"UniqueMachines\" in df.columns:\n",
65+
" print(f\"Total unique machines: {df['UniqueMachines'].sum():,}\")\n",
6466
" except Exception as e:\n",
6567
" print(f\" ⚠️ {e}\")"
6668
]

0 commit comments

Comments
 (0)