Skip to content

Commit c97aa79

Browse files
committed
update query
1 parent 8b40706 commit c97aa79

3 files changed

Lines changed: 119 additions & 195 deletions

File tree

Lines changed: 39 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,30 @@
1-
// =============================================================================
2-
// MANAGER_REGISTRATION.FAILED — Property Validation by Manager × Error Type (stable >= 1.24.0)
3-
// For each manager, shows the breakdown of error types from registration failures.
4-
// errorType reference: spawn_timeout, spawn_enoent, permission_denied, canceled,
5-
// parse_error, process_crash, unknown.
6-
// MachinePct = % of all stable machines that hit this manager+errorType combination.
7-
// =============================================================================
8-
RawEventsVSCodeExt
9-
| where ServerTimestamp > ago(28d)
10-
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
11-
| extend ExtVersion = tostring(Properties["common.extversion"])
12-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
13-
| where _minor >= 24 and (_minor % 2) == 0
14-
| summarize
15-
EventCount = count(),
16-
UniqueMachines = dcount(VSCodeMachineId)
17-
by ManagerName = tostring(Properties.managername), ErrorType = tostring(Properties.errortype)
18-
| extend TotalUniqueMachines = toscalar(
19-
RawEventsVSCodeExt
20-
| where ServerTimestamp > ago(28d)
21-
| where ExtensionName == "ms-python.vscode-python-envs"
22-
| where ExtensionVersion != ""
23-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtensionVersion))
24-
| where _minor >= 24 and (_minor % 2) == 0
25-
| summarize dcount(VSCodeMachineId)
26-
)
27-
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalUniqueMachines) * 100, 2)
28-
| order by EventCount desc
29-
30-
311
// =============================================================================
322
// MANAGER_REGISTRATION.FAILED — Total Failures by Manager × Extension Version (stable >= 1.24.0)
333
// Total failure count per manager per version, regardless of error type.
344
// MachinePct = % of machines on that version that had any registration failure for this manager.
355
// Same manager name appears in consecutive rows, sorted by version ascending.
6+
// materialize() is used only for the lean denominator (VSCodeMachineId + ExtVersion, no Properties)
7+
// to stay within the cluster's materialize cache limit. Failures are scanned separately since
8+
// manager_registration.failed events are a tiny fraction of total events.
369
// =============================================================================
37-
let totalByVersion = RawEventsVSCodeExt
38-
| where ServerTimestamp > ago(28d)
39-
| where ExtensionName == "ms-python.vscode-python-envs"
40-
| extend ExtVersion = tostring(Properties["common.extversion"])
41-
| where ExtVersion != ""
42-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
43-
| where _minor >= 24 and (_minor % 2) == 0
44-
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion;
45-
RawEventsVSCodeExt
46-
| where ServerTimestamp > ago(28d)
47-
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
48-
| extend ExtVersion = tostring(Properties["common.extversion"])
49-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
50-
| where _minor >= 24 and (_minor % 2) == 0
51-
| summarize
52-
EventCount = count(),
53-
UniqueMachines = dcount(VSCodeMachineId)
54-
by ManagerName = tostring(Properties.managername), ExtVersion
55-
| join kind=inner totalByVersion on ExtVersion
56-
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalMachines) * 100, 2)
57-
| project ManagerName, ExtVersion, EventCount, UniqueMachines, TotalMachines, MachinePct
58-
| order by ManagerName asc, ExtVersion asc
59-
60-
61-
// =============================================================================
62-
// SPAWN_TIMEOUT Failures by Manager × Extension Version (stable >= 1.24.0)
63-
// Shows whether spawn_timeout is improving or worsening across stable releases.
64-
// If a new stable version shows higher MachinePct → that release regressed timeout handling.
65-
// =============================================================================
66-
let totalByVersion = RawEventsVSCodeExt
67-
| where ServerTimestamp > ago(28d)
68-
| where ExtensionName == "ms-python.vscode-python-envs"
69-
| where ExtensionVersion != ""
70-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtensionVersion))
71-
| where _minor >= 24 and (_minor % 2) == 0
72-
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion = ExtensionVersion;
10+
let stableVersions = materialize(
11+
RawEventsVSCodeExt
12+
| where ServerTimestamp > ago(28d)
13+
| where ExtensionName == "ms-python.vscode-python-envs"
14+
| extend ExtVersion = tostring(Properties["common.extversion"])
15+
| where isnotempty(ExtVersion)
16+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
17+
| where _minor >= 24 and (_minor % 2) == 0
18+
| project VSCodeMachineId, ExtVersion
19+
);
20+
let totalByVersion = stableVersions
21+
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion;
7322
RawEventsVSCodeExt
7423
| where ServerTimestamp > ago(28d)
7524
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
7625
| extend ExtVersion = tostring(Properties["common.extversion"])
7726
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
7827
| where _minor >= 24 and (_minor % 2) == 0
79-
| where tostring(Properties.errortype) == "spawn_timeout"
8028
| summarize
8129
EventCount = count(),
8230
UniqueMachines = dcount(VSCodeMachineId)
@@ -87,63 +35,37 @@ RawEventsVSCodeExt
8735
| order by ManagerName asc, ExtVersion asc
8836

8937

90-
9138
// =============================================================================
92-
// Process Crash Failures by Manager × Extension Version (stable >= 1.24.0)
93-
// Uses leftouter join from totalByVersion so ALL stable versions appear, including
94-
// those with 0 crashes. With kind=inner, versions that had no process_crash failures
95-
// (e.g. 1.24.x) are silently dropped — that's why only 1.26.0 was visible before.
39+
// SPAWN_TIMEOUT / PROCESS_CRASH / UNKNOWN Failures by Manager × Version (stable >= 1.24.0)
40+
// Merged from three separate queries into one to reduce table scans.
41+
// ErrorType column distinguishes the three categories — filter on it to reproduce the old views.
42+
// Note: versions with zero failures for a given error type are omitted (no row = no failures).
43+
// materialize() used only for the lean denominator; failures scanned separately.
9644
// =============================================================================
97-
let totalByVersion = RawEventsVSCodeExt
98-
| where ServerTimestamp > ago(28d)
99-
| where ExtensionName == "ms-python.vscode-python-envs"
100-
| where ExtensionVersion != ""
101-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtensionVersion))
102-
| where _minor >= 24 and (_minor % 2) == 0
103-
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion = ExtensionVersion;
104-
let crashes = RawEventsVSCodeExt
105-
| where ServerTimestamp > ago(28d)
106-
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
107-
| extend ExtVersion = tostring(Properties["common.extversion"])
108-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
109-
| where _minor >= 24 and (_minor % 2) == 0
110-
| where tostring(Properties.errortype) == "process_crash"
111-
| summarize
112-
EventCount = count(),
113-
UniqueMachines = dcount(VSCodeMachineId)
114-
by ManagerName = tostring(Properties.managername), ExtVersion;
115-
totalByVersion
116-
| join kind=leftouter crashes on ExtVersion
117-
| where isnotempty(ManagerName)
118-
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalMachines) * 100, 2)
119-
| project ManagerName, ExtVersion, EventCount, UniqueMachines, TotalMachines, MachinePct
120-
| order by ManagerName asc, ExtVersion asc
121-
122-
123-
// =============================================================================
124-
// UNKNOWN Failures by Manager × Extension Version (stable >= 1.24.0)
125-
// Shows whether unknown (unclassified) errors are improving or worsening across stable releases.
126-
// High counts in the latest stable version → new unclassified error paths need investigation.
127-
// =============================================================================
128-
let totalByVersion = RawEventsVSCodeExt
129-
| where ServerTimestamp > ago(28d)
130-
| where ExtensionName == "ms-python.vscode-python-envs"
131-
| where ExtensionVersion != ""
132-
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtensionVersion))
133-
| where _minor >= 24 and (_minor % 2) == 0
134-
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion = ExtensionVersion;
45+
let stableVersions = materialize(
46+
RawEventsVSCodeExt
47+
| where ServerTimestamp > ago(28d)
48+
| where ExtensionName == "ms-python.vscode-python-envs"
49+
| extend ExtVersion = tostring(Properties["common.extversion"])
50+
| where isnotempty(ExtVersion)
51+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
52+
| where _minor >= 24 and (_minor % 2) == 0
53+
| project VSCodeMachineId, ExtVersion
54+
);
55+
let totalByVersion = stableVersions
56+
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion;
13557
RawEventsVSCodeExt
13658
| where ServerTimestamp > ago(28d)
13759
| where EventName == "ms-python.vscode-python-envs/manager_registration.failed"
60+
| where tostring(Properties.errortype) in ("spawn_timeout", "process_crash", "unknown")
13861
| extend ExtVersion = tostring(Properties["common.extversion"])
13962
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
14063
| where _minor >= 24 and (_minor % 2) == 0
141-
| where tostring(Properties.errortype) == "unknown"
142-
| summarize
143-
EventCount = count(),
144-
UniqueMachines = dcount(VSCodeMachineId)
145-
by ManagerName = tostring(Properties.managername), ExtVersion
64+
| summarize EventCount = count(), UniqueMachines = dcount(VSCodeMachineId)
65+
by ManagerName = tostring(Properties.managername),
66+
ErrorType = tostring(Properties.errortype),
67+
ExtVersion
14668
| join kind=inner totalByVersion on ExtVersion
14769
| extend MachinePct = round(todouble(UniqueMachines) / todouble(TotalMachines) * 100, 2)
148-
| project ManagerName, ExtVersion, EventCount, UniqueMachines, TotalMachines, MachinePct
149-
| order by ManagerName asc, ExtVersion asc
70+
| project ManagerName, ErrorType, ExtVersion, EventCount, UniqueMachines, TotalMachines, MachinePct
71+
| order by ManagerName asc, ErrorType asc, ExtVersion asc
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// =============================================================================
2+
// MANAGER.LAZY_INIT — Error Type Breakdown by Manager × Version (stable >= 1.28.0)
3+
// Replaces MANAGER_REGISTRATION.FAILED for pipenv, poetry, and pyenv after PR #1423.
4+
// From 1.28.0 onward these managers register unconditionally at startup and defer all tool
5+
// detection to first use, so spawn_timeout / process_crash / unknown etc. are no longer
6+
// reported in MANAGER_REGISTRATION.FAILED — they appear here instead.
7+
//
8+
// Denominator: machines that sent ANY MANAGER.LAZY_INIT event for that manager+version
9+
// (success + tool_not_found + error combined). This gives:
10+
// MachinePct = errors / machines_that_engaged_with_manager * 100
11+
// which is much closer to the pre-1.28.0 MANAGER_REGISTRATION.FAILED rate than using
12+
// all active machines as the denominator. Remaining caveat: pre-1.28.0 registration ran
13+
// on every VS Code launch for all machines; post-1.28.0 only machines where the user
14+
// actually opened the environment picker contribute, so rates are still not identical.
15+
//
16+
// Columns:
17+
// ManagerName — pipenv | poetry | pyenv
18+
// ErrorType — spawn_timeout | process_crash | unknown | spawn_enoent | ...
19+
// ExtVersion — stable extension version (even minor >= 28)
20+
// EventCount — total error events (one machine can contribute multiple across sessions)
21+
// Machines — distinct machines that hit this manager+errorType on this version
22+
// TotalByManager — distinct machines that sent any MANAGER.LAZY_INIT for this manager+version
23+
// TotalMachines — distinct machines that sent any MANAGER.LAZY_INIT (any manager) on this version
24+
// MachinePct — Machines / TotalByManager * 100
25+
// =============================================================================
26+
let lazyInitBase = materialize(
27+
RawEventsVSCodeExt
28+
| where ServerTimestamp > ago(28d)
29+
| where EventName == "ms-python.vscode-python-envs/manager.lazy_init"
30+
| extend ExtVersion = tostring(Properties["common.extversion"])
31+
| where isnotempty(ExtVersion)
32+
| extend _minor = toint(extract("^1\\.(\\d+)", 1, ExtVersion))
33+
| where _minor >= 28 and (_minor % 2) == 0
34+
| project VSCodeMachineId, ExtVersion,
35+
ManagerName = tostring(Properties.managername),
36+
Result = tostring(Properties.result),
37+
ErrorType = tostring(Properties.errortype)
38+
);
39+
let totalMachines = lazyInitBase
40+
| summarize TotalMachines = dcount(VSCodeMachineId) by ExtVersion;
41+
let totalByManager = lazyInitBase
42+
| summarize TotalByManager = dcount(VSCodeMachineId) by ManagerName, ExtVersion;
43+
lazyInitBase
44+
| where Result == "error"
45+
| summarize EventCount = count(), Machines = dcount(VSCodeMachineId)
46+
by ManagerName, ErrorType, ExtVersion
47+
| join kind=inner totalByManager on ManagerName, ExtVersion
48+
| join kind=inner totalMachines on ExtVersion
49+
| extend MachinePct = round(todouble(Machines) / todouble(TotalByManager) * 100, 2)
50+
| project ManagerName, ErrorType, ExtVersion, EventCount, Machines, TotalByManager, TotalMachines, MachinePct
51+
| order by ManagerName asc, ErrorType asc, ExtVersion asc

analysis/kusto/dashboard-stable.ipynb

Lines changed: 29 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,11 @@
4444
"metadata": {},
4545
"source": [
4646
"---\n",
47-
"## 1. MANAGER_REGISTRATION.FAILED — Property Validation (stable >= 1.24.0)\n",
47+
"## 1. MANAGER_REGISTRATION.FAILED — Total Failures by Manager × Version (stable >= 1.24.0)\n",
4848
"\n",
49-
"For each manager, shows the breakdown of **error types** from registration failures.\n",
50-
"`MachinePct` = % of all stable machines that hit this manager + error type combination.\n",
51-
"\n",
52-
"| Error type | Meaning |\n",
53-
"|---|---|\n",
54-
"| `spawn_timeout` | Tool process hung or didn't respond in time |\n",
55-
"| `spawn_enoent` | OS couldn't find the executable (not installed or not on PATH) |\n",
56-
"| `permission_denied` | Exists but no permission to run (EACCES/EPERM) |\n",
57-
"| `canceled` | Operation stopped (user closed VS Code / CancellationToken fired) |\n",
58-
"| `parse_error` | Tool ran but returned unparseable output |\n",
59-
"| `process_crash` | Process started but exited with a non-zero code unexpectedly |\n",
60-
"| `unknown` | Catch-all for unexpected errors |"
49+
"Total failure count per manager per extension version, regardless of error type.\n",
50+
"`MachinePct` = % of machines on that version that had any registration failure for this manager.\n",
51+
"Same manager name appears in consecutive rows, sorted by version ascending.\n"
6152
]
6253
},
6354
{
@@ -69,8 +60,8 @@
6960
"source": [
7061
"title, query = sections_09[0]\n",
7162
"display(Markdown(f\"### {title}\"))\n",
72-
"df_prop = run_kql(client, query)\n",
73-
"display(df_prop)"
63+
"df_failures_by_version = run_kql(client, query)\n",
64+
"display(df_failures_by_version)\n"
7465
]
7566
},
7667
{
@@ -79,11 +70,14 @@
7970
"metadata": {},
8071
"source": [
8172
"---\n",
82-
"## 2. MANAGER_REGISTRATION.FAILED — Total Failures by Manager × Version (stable >= 1.24.0)\n",
73+
"## 2. SPAWN_TIMEOUT / PROCESS_CRASH / UNKNOWN Failures by Manager × Version (stable >= 1.24.0)\n",
8374
"\n",
84-
"Total failure count per manager per extension version, regardless of error type.\n",
85-
"`MachinePct` = % of machines on that version that had any registration failure for this manager.\n",
86-
"Same manager name appears in consecutive rows, sorted by version ascending."
75+
"Merged query for the three most actionable error types. Use the `ErrorType` column to filter.\n",
76+
"- `spawn_timeout` — PET hung; rising `MachinePct` in a new version → timeout regression\n",
77+
"- `process_crash` — PET exited non-zero; rising `MachinePct` → crash regression\n",
78+
"- `unknown` — unclassified errors; high counts in latest version → new paths need classification\n",
79+
"\n",
80+
"Versions with zero failures for a given error type are absent (no row = no failures).\n"
8781
]
8882
},
8983
{
@@ -95,8 +89,8 @@
9589
"source": [
9690
"title, query = sections_09[1]\n",
9791
"display(Markdown(f\"### {title}\"))\n",
98-
"df_failures_by_version = run_kql(client, query)\n",
99-
"display(df_failures_by_version)"
92+
"df_error_types = run_kql(client, query)\n",
93+
"display(df_error_types)\n"
10094
]
10195
},
10296
{
@@ -105,74 +99,31 @@
10599
"metadata": {},
106100
"source": [
107101
"---\n",
108-
"## 3. SPAWN_TIMEOUT Failures by Manager × Version (stable >= 1.24.0)\n",
102+
"## 3. MANAGER.LAZY_INIT — Error Type Breakdown for pipenv / poetry / pyenv (stable >= 1.28.0)\n",
109103
"\n",
110-
"Shows whether `spawn_timeout` is improving or worsening across stable releases.\n",
111-
"If a new stable version shows higher `MachinePct` → that release regressed timeout handling."
112-
]
113-
},
114-
{
115-
"cell_type": "code",
116-
"execution_count": null,
117-
"id": "7",
118-
"metadata": {},
119-
"outputs": [],
120-
"source": [
121-
"title, query = sections_09[2]\n",
122-
"display(Markdown(f\"### {title}\"))\n",
123-
"df_timeout = run_kql(client, query)\n",
124-
"display(df_timeout)"
125-
]
126-
},
127-
{
128-
"cell_type": "markdown",
129-
"id": "8",
130-
"metadata": {},
131-
"source": [
132-
"---\n",
133-
"## 4. Process Crash Failures by Manager × Version (stable >= 1.24.0)\n",
104+
"From **1.28.0** (PR #1423), these three managers no longer emit `MANAGER_REGISTRATION.FAILED`.\n",
105+
"Errors (`spawn_timeout`, `process_crash`, `unknown`, etc.) are now reported in `MANAGER.LAZY_INIT`\n",
106+
"and only fire on **first actual use**, not at every startup.\n",
134107
"\n",
135-
"Shows `process_crash` failures across all stable versions.\n",
136-
"Versions with no crashes show `EventCount = 0` — confirming the absence of regressions, not missing data.\n",
137-
"If a new stable version shows higher `MachinePct` → that release introduced a crash regression."
138-
]
139-
},
140-
{
141-
"cell_type": "code",
142-
"execution_count": null,
143-
"id": "9",
144-
"metadata": {},
145-
"outputs": [],
146-
"source": [
147-
"title, query = sections_09[3]\n",
148-
"display(Markdown(f\"### {title}\"))\n",
149-
"df_crashes = run_kql(client, query)\n",
150-
"display(df_crashes)"
151-
]
152-
},
153-
{
154-
"cell_type": "markdown",
155-
"id": "10",
156-
"metadata": {},
157-
"source": [
158-
"---\n",
159-
"## 5. UNKNOWN Failures by Manager × Version (stable >= 1.24.0)\n",
108+
"**Denominator:** machines that sent *any* `MANAGER.LAZY_INIT` event for that manager+version\n",
109+
"(success + tool_not_found + error). This means `MachinePct` = failure rate among machines that\n",
110+
"actually engaged with the manager — closer to the pre-1.28.0 meaning than using all active\n",
111+
"machines as denominator.\n",
160112
"\n",
161-
"Shows whether unclassified (`unknown`) errors are improving or worsening across stable releases.\n",
162-
"High counts in the latest stable version → new unclassified error paths need investigation and classification."
113+
"**Remaining caveat:** pre-1.28.0, registration ran on *every* VS Code launch for *all* machines.\n",
114+
"Post-1.28.0, only users who opened the environment picker contribute. Rates are closer but still\n",
115+
"not identical — a manager with very low engagement will show a noisier, potentially inflated rate.\n"
163116
]
164117
},
165118
{
166119
"cell_type": "code",
167120
"execution_count": null,
168-
"id": "11",
121+
"id": "7",
169122
"metadata": {},
170123
"outputs": [],
171124
"source": [
172-
"title, query = sections_09[4]\n",
173-
"display(Markdown(f\"### {title}\"))\n",
174-
"df_unknown = run_kql(client, query)\n",
175-
"display(df_unknown)"
125+
"df_lazy_errors = run_kql_file(client, \"10-stable-lazy-init-telemetry.kql\")\n",
126+
"display(df_lazy_errors)\n"
176127
]
177128
}
178129
],

0 commit comments

Comments
 (0)