mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
Track executor MCP discovery telemetry (#41205)
## What changed - Count remote executor MCP discovery attempts, including refreshes, with `success` and `error` outcomes. - Count each discovered server by name and report whether it was found or unavailable before policy and startup filtering. GitOrigin-RevId: b912aa64b606e6243cce79df0fe85d485a2c3547
This commit is contained in:
1 parent
d4d2b293b4
commit
e931d07b88
1 file changed
+25
-3
@@ -162,10 +162,22 @@ impl Session {
|
||||
}
|
||||
|
||||
let environment_id = &selected.selection.environment_id;
|
||||
let servers = match environment
|
||||
let discovery = environment
|
||||
.discover_http_mcp_servers(selected.cwd().clone())
|
||||
.await
|
||||
{
|
||||
.await;
|
||||
let outcome = if discovery.is_ok() {
|
||||
"success"
|
||||
} else {
|
||||
"error"
|
||||
};
|
||||
// Count completed discovery attempts, including refreshes, before host policy
|
||||
// or MCP startup determines whether the server's tools become available.
|
||||
self.services.session_telemetry.counter(
|
||||
"codex.mcp.executor_discovery",
|
||||
/*inc*/ 1,
|
||||
&[("outcome", outcome)],
|
||||
);
|
||||
let servers = match discovery {
|
||||
Ok(servers) => servers,
|
||||
Err(error) => {
|
||||
tracing::warn!(
|
||||
@@ -177,6 +189,16 @@ impl Session {
|
||||
}
|
||||
};
|
||||
for (name, mut server) in servers {
|
||||
let outcome = if server.enabled {
|
||||
"found"
|
||||
} else {
|
||||
"unavailable"
|
||||
};
|
||||
self.services.session_telemetry.counter(
|
||||
"codex.mcp.executor_discovery.server",
|
||||
/*inc*/ 1,
|
||||
&[("server_name", name.as_str()), ("outcome", outcome)],
|
||||
);
|
||||
if name == CODEX_APPS_MCP_SERVER_NAME
|
||||
|| !server.is_local_environment()
|
||||
|| projection
|
||||
|
||||
Reference in new issue
Block a user