Instrument environment and plugin resolution paths (#33223)

## What changed

Add named tracing spans around step environment snapshots, capability and
executor plugin resolution, `AGENTS.md` refreshes, and MCP runtime projection
and refresh operations. Skip recording function arguments to keep these spans
focused on timing and execution flow.

GitOrigin-RevId: 73a452ef1b5da6f7f2b00d24421a815c5d514eaf
This commit is contained in:
rphilizaire-openai authored and copyberry committed 2026-07-15 03:27:16 +00:00
1 parent 3f74f00295
commit 35b33e4304
11 files changed
+12

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ impl AgentsMdManager {
}
}
#[tracing::instrument(name = "agents_md.refresh", skip_all)]
pub(crate) async fn refresh(&self, config: &Config, environments: &TurnEnvironmentSnapshot) {
let selections = environments.to_selections();
if self.cache.lock().await.selections.as_ref() == Some(&selections) {
@@ -195,6 +195,7 @@ impl ThreadEnvironments {
.boxed()
}
#[tracing::instrument(name = "environments.snapshot", skip_all)]
pub(crate) async fn snapshot(&self) -> TurnEnvironmentSnapshot {
let current = self.environments.load_full();
let mut turn_environments = Vec::with_capacity(current.len());
+1
View File
@@ -100,6 +100,7 @@ impl McpManager {
.config
}
#[tracing::instrument(name = "mcp.runtime_config.project_for_step", skip_all)]
pub(crate) async fn runtime_config_for_step(
&self,
config: &Config,
+2
View File
@@ -109,6 +109,7 @@ impl Session {
clippy::await_holding_invalid_type,
reason = "MCP runtime comparison and publication must remain serialized"
)]
#[tracing::instrument(name = "mcp.runtime.resolve_for_step", skip_all)]
pub(crate) async fn mcp_runtime_for_step(
self: &Arc<Self>,
turn_context: &TurnContext,
@@ -319,6 +320,7 @@ impl Session {
.await
}
#[tracing::instrument(name = "mcp.runtime.refresh", skip_all)]
async fn refresh_mcp_servers_inner(
&self,
turn_context: &TurnContext,