Record Windows sandbox private desktop usage (#42596)

## What changed

Increment the `codex.windows_sandbox.private_desktop` counter when preparing a
Windows restricted-token sandbox execution, tagging it with whether private
desktop isolation is enabled.

GitOrigin-RevId: 1eb5e183b57e19753dc133dbe152eabe23dd2a23
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-03 18:25:13 +00:00
1 parent 2387310b52
commit f60dfe80b5
1 file changed
+16 -5
+16 -5
View File
@@ -451,11 +451,22 @@ impl SandboxManager {
.to_string(), .to_string(),
)); ));
} }
( let pending = pending_sandboxed_request?;
os_argv_to_strings(argv), if let Some(metrics) = codex_otel::global() {
None, let _ = metrics.counter(
Some(pending_sandboxed_request?), "codex.windows_sandbox.private_desktop",
) /*inc*/ 1,
&[(
"enabled",
if windows_sandbox_private_desktop {
"true"
} else {
"false"
},
)],
);
}
(os_argv_to_strings(argv), None, Some(pending))
} }
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
SandboxType::WindowsRestrictedToken => ( SandboxType::WindowsRestrictedToken => (