[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69B97ZASA3N4SR0XAFFJN7W":3,"skill-same:01M69B97ZASA3N4SR0XAFFJN7W":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":17,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M69B97ZASA3N4SR0XAFFJN7W","deep-analysis","分布式追踪深度分析","Cross-resource deep analysis of a specific distributed trace. Takes an operation ID and correlates telemetry across multiple Application Insights resources to build a unified picture of a distributed operation.","对特定分布式跟踪进行跨资源深度分析。接收一个操作 ID（operation ID），关联多个 Application Insights 资源中的遥测数据，构建出该分布式操作的统一视图。","microsoft\u002Fcode-optimizations-skills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69B946558R676VBQ1AFQVBM",5,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeep-analysis\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRSRYQ3M8N5063NNQPF2B1","调试与故障排查","SCENARIO","使用场景",[31,32,33],"deep analysis","telemetry","distributed","2026-11-10 10:12:30",false,"---\nname: deep-analysis\ncategory: investigating\ndescription: Cross-resource deep analysis of a specific distributed trace. Takes an operation ID and correlates telemetry across multiple Application Insights resources to build a unified picture of a distributed operation.\n---\n\n# Deep Analysis\n\nThis skill performs cross-resource deep analysis of a specific distributed trace. Given an operation ID (from any skill's output or from the user), it discovers related Application Insights resources, queries each for correlated telemetry, and presents a unified timeline showing where time was spent and what went wrong.\n\n## Prerequisites\n\n- The user must be logged in to Azure CLI (`az login`)\n- A primary Application Insights resource must be identified (in `investigation-notes.md` or provided by the user)\n- An **operation ID** to investigate (typically surfaced by the `agentic-optimization` or `perf-optimization` skill)\n\n## Steps\n\n### 1–2. Check investigation notes and gather inputs\n\nFollow the [Standard Skill Preamble](..\u002Fshared\u002Fstandard-skill-preamble.md) to check for existing investigation context and gather inputs.\n\nIn addition to the standard App ID and resource identity fields, this skill requires:\n\n- **Operation ID**: The distributed trace operation ID to investigate. This is typically:\n  - An operation ID from an anomaly flagged by the `agentic-optimization` skill\n  - A request ID from a slow request surfaced by the `perf-optimization` skill\n  - An operation ID provided directly by the user (e.g., from Application Insights transaction search)\n\nIf the user doesn't have an operation ID, suggest they first run the `agentic-optimization` or `perf-optimization` skill to identify interesting operations.\n\n### 3. Discover related resources\n\nCheck whether `investigation-notes.md` has a **\"Related Resources\"** section with previously discovered resources.\n\n- If **related resources exist** → present them to the user and ask whether to reuse or re-discover.\n- If **no related resources** → run [discover-related-resources.md](..\u002Fshared\u002Fdiscover-related-resources.md) to find downstream App Insights resources. This uses 4 targeted strategies (same resource group, dependency IKey correlation, shared workspace, local config scan).\n\n> **AI agent workloads**: For AI agent scenarios, dependency telemetry often has `target=unknown` (type=AI), making dependency-based discovery ineffective. The **local config scan** (strategy 3d) is typically the most reliable — tool endpoints and connection strings are usually in the source code. Also note that downstream resources may be in a **different subscription** than the agent — the discovery script uses cross-subscription Resource Graph queries to handle this.\n\nAfter discovery, confirm the list of resources with the user. Each resource should have a role label (e.g., \"Agent host\", \"Tool: SearchAPI\").\n\n### 4. Fetch operation context from primary resource\n\nQuery the primary App Insights resource for the full trace of the given operation ID. This establishes the baseline view of the distributed operation.\n\n> ⚠️ Before running queries, review [az CLI query pitfalls](..\u002Fshared\u002Faz-cli-query-pitfalls.md).\n\n#### 4a. Query requests, dependencies, and exceptions for the operation\n\n```powershell\n$resourceId = \"\u003CPRIMARY_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n# Fetch all telemetry for this operation: requests, dependencies, exceptions, traces\n$query = \"union requests, dependencies, exceptions, traces | where operation_Id == '$operationId' | project timestamp, itemType, name, duration, resultCode, target, type, operation_ParentId, id, problemId, message | order by timestamp asc\"\n\n$result = az monitor app-insights query `\n  --apps \"$resourceId\" `\n  --analytics-query \"$query\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -ne 0) {\n  Write-Host \"ERROR: Query failed for primary resource.\"\n  Write-Host $result\n} else {\n  $parsed = $result | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  Write-Host \"Found $($rows.Count) telemetry item(s) for operation $operationId in primary resource\"\n}\n```\n\n#### 4b. If using agentic-optimization — also fetch agent-specific context\n\nIf the operation originated from an AI agent analysis (e.g., flagged by the `agentic-optimization` skill), also run:\n\n```powershell\n# Use aira.exe response-context for richer agent-specific context\n$token = (az account get-access-token --resource \"https:\u002F\u002Fapi.applicationinsights.io\" --query accessToken -o tsv)\n\n$scriptDir = \"$PSScriptRoot\\..\\agentic-optimization\\scripts\"\n$exePath = Join-Path $scriptDir \"aira.exe\"\n\n& $exePath response-context `\n  -s \"$subscriptionId\" -g \"$resourceGroup\" -c \"$componentName\" `\n  --access \"$token\" `\n  --response-id \"$operationId\" `\n  -o json\n```\n\n> This step is optional — skip it if the operation is not from an AI agent workload or if `aira.exe` is not available.\n\n### 5. Correlate across downstream resources\n\nFor each related resource in the investigation notes, query for telemetry correlated to the same operation ID. The Application Insights SDK propagates operation IDs across service boundaries when distributed tracing is enabled.\n\n```powershell\n$relatedResourceId = \"\u003CRELATED_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n$query = \"union requests, dependencies, exceptions, traces | where operation_Id == '$operationId' | project timestamp, itemType, name, duration, resultCode, target, type, operation_ParentId, id, problemId, message | order by timestamp asc\"\n\n$result = az monitor app-insights query `\n  --apps \"$relatedResourceId\" `\n  --analytics-query \"$query\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -eq 0) {\n  $parsed = $result | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  Write-Host \"Found $($rows.Count) telemetry item(s) in resource: \u003CRESOURCE_NAME>\"\n} else {\n  Write-Host \"WARNING: Query failed for resource \u003CRESOURCE_NAME>. The operation may not have reached this service.\"\n}\n```\n\nRun this for each related resource. Collect all results.\n\nAdditionally, for each related resource that has telemetry for this operation:\n- **Check for profiler traces** — query `customEvents` for `ServiceProfilerSample` events covering the operation's time window. If found, note this for the user — they can use `get-profile-hotpath` for method-level analysis.\n- **Check for exceptions** — highlight any exceptions correlated to the operation.\n\n```powershell\n$relatedResourceId = \"\u003CRELATED_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n# Derive the operation's time window from the telemetry fetched above.\n# Use the min\u002Fmax timestamps from the operation's events, with a 2-minute buffer\n# on each side to account for profiler sampling intervals.\n# $operationStart and $operationEnd should be ISO 8601 UTC strings computed from\n# the earliest and latest timestamps in the operation's telemetry results.\n$operationStart = \"\u003CISO 8601 UTC — earliest event timestamp minus 2 minutes>\"\n$operationEnd = \"\u003CISO 8601 UTC — latest event timestamp plus 2 minutes>\"\n\n# Check for profiler coverage in this time window\n$profilerQuery = \"customEvents | where name == 'ServiceProfilerSample' | where timestamp between (datetime('$operationStart') .. datetime('$operationEnd')) | take 1\"\n\n$profilerResult = az monitor app-insights query `\n  --apps \"$relatedResourceId\" `\n  --analytics-query \"$profilerQuery\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -eq 0) {\n  $parsed = $profilerResult | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  if ($rows.Count -gt 0) {\n    Write-Host \"Profiler trace available for this time window in resource: \u003CRESOURCE_NAME>\"\n  }\n}\n```\n\n### 6. Present cross-resource findings\n\nMerge all telemetry from the primary and related resources into a **unified timeline**. Present it to the user with:\n\n1. **Timeline view** — All events ordered by timestamp, annotated with which resource they came from and their role label:\n   ```\n   [00:00.000] Agent host     | REQUEST  POST \u002Fapi\u002Fchat              (2,450ms)\n   [00:00.050] Agent host     | DEPENDENCY  SearchAPI.Search         (1,200ms) → Tool: SearchAPI\n   [00:00.060] Tool: SearchAPI| REQUEST  POST \u002Fsearch                (1,180ms)\n   [00:00.070] Tool: SearchAPI| DEPENDENCY  Azure Cognitive Search   (950ms)\n   [00:01.300] Agent host     | DEPENDENCY  OpenAI.ChatCompletion   (800ms)\n   [00:02.200] Agent host     | REQUEST  POST \u002Fapi\u002Fchat completed    (2,450ms)\n   ```\n\n2. **Time breakdown** — Where was time spent? Show percentage per resource\u002Fdependency:\n   ```\n   Total: 2,450ms\n     SearchAPI call:     1,200ms (49%)  ← profiler available\n     OpenAI call:          800ms (33%)\n     Agent processing:     450ms (18%)\n   ```\n\n3. **Issues found** — Highlight:\n   - Exceptions or error status codes\n   - Dependencies with unusually high latency\n   - Missing telemetry gaps (time unaccounted for)\n   - Resources where the operation ID was NOT found (possible instrumentation gap)\n\n4. **Profiler availability** — For resources with profiler data covering this time window, note that method-level analysis is available.\n\n### 6b. Source code analysis for bottleneck tool calls\n\nWhen the cross-resource analysis identifies a **tool call or API call** as the dominant bottleneck (e.g., >50% of total operation time), scan the local codebase for the tool's implementation to identify the root cause.\n\nThis is especially valuable for AI agent workloads where the agent and its tools are often in the same repository.\n\n1. **Identify the tool name** from the telemetry (e.g., `execute_tool remote_openapi.GetUserFunc_GetUsers`)\n2. **Search the codebase** for the function implementation — look for matching function names, API route definitions, or OpenAPI operation IDs\n3. **Examine the implementation** for common bottlenecks:\n   - Slow SQL queries (missing indexes, N+1 queries, `WAITFOR DELAY`, full table scans)\n   - Unoptimized external API calls (missing caching, sequential instead of parallel calls)\n   - Large data transfers (returning all rows without pagination)\n   - Blocking I\u002FO (synchronous calls in async contexts)\n4. **Present findings** to the user with the specific code location and a concrete optimization recommendation\n\n> If the source code is not available in the working directory, inform the user and suggest they provide the repository path or examine the code manually.\n\n### 7. Suggest next steps\n\nBased on the findings, offer actionable follow-ups:\n\n- **Profiler deep-dive**: If a downstream resource has profiler data (detected in step 5's profiler check) → offer to invoke `get-profile-hotpath` immediately, passing the trace location ID from the `ServiceProfilerSample` event's `customDimensions.ServiceProfilerContent` field. This provides method-level call tree analysis without requiring the user to switch skills manually.\n- **Performance optimization**: If a downstream resource shows high latency → suggest `perf-optimization` targeting that resource\n- **Code optimizations**: If a downstream resource has Code Optimization recommendations → suggest fetching them\n- **Compare agent versions**: If the issue correlates with a specific agent version → suggest `aira.exe compare-versions`\n- **Widen investigation**: If the operation ID wasn't found in some related resources → the trace may not propagate there; suggest checking instrumentation or trying a different operation\n\n## Tips\n\n- Start with the primary resource context (step 4) before querying downstream resources — this gives you the dependency call graph to guide which resources matter most.\n- Not all related resources will have telemetry for a given operation. This is expected — the agent may not call every downstream service on every request.\n- If distributed tracing headers aren't propagated, the operation ID won't match across resources. In this case, fall back to time-based correlation (query by timestamp range instead of operation ID).\n- The timeline view is most useful when presented as a compact table or tree. Avoid overwhelming the user with raw telemetry — summarize and highlight.\n\n## References\n\n- [Discover Related Resources](..\u002Fshared\u002Fdiscover-related-resources.md)\n- [Investigation Notes](..\u002Fshared\u002Finvestigation-notes.md)\n- [az CLI Query Pitfalls](..\u002Fshared\u002Faz-cli-query-pitfalls.md)\n- [Standard Skill Preamble](..\u002Fshared\u002Fstandard-skill-preamble.md)\n- [Resolve App ID](..\u002Fshared\u002Fresolve-app-id.md)\n","# Deep Analysis\n\nThis skill performs cross-resource deep analysis of a specific distributed trace. Given an operation ID (from any skill's output or from the user), it discovers related Application Insights resources, queries each for correlated telemetry, and presents a unified timeline showing where time was spent and what went wrong.\n\n## Prerequisites\n\n- The user must be logged in to Azure CLI (`az login`)\n- A primary Application Insights resource must be identified (in `investigation-notes.md` or provided by the user)\n- An **operation ID** to investigate (typically surfaced by the `agentic-optimization` or `perf-optimization` skill)\n\n## Steps\n\n### 1–2. Check investigation notes and gather inputs\n\nFollow the [Standard Skill Preamble](..\u002Fshared\u002Fstandard-skill-preamble.md) to check for existing investigation context and gather inputs.\n\nIn addition to the standard App ID and resource identity fields, this skill requires:\n\n- **Operation ID**: The distributed trace operation ID to investigate. This is typically:\n  - An operation ID from an anomaly flagged by the `agentic-optimization` skill\n  - A request ID from a slow request surfaced by the `perf-optimization` skill\n  - An operation ID provided directly by the user (e.g., from Application Insights transaction search)\n\nIf the user doesn't have an operation ID, suggest they first run the `agentic-optimization` or `perf-optimization` skill to identify interesting operations.\n\n### 3. Discover related resources\n\nCheck whether `investigation-notes.md` has a **\"Related Resources\"** section with previously discovered resources.\n\n- If **related resources exist** → present them to the user and ask whether to reuse or re-discover.\n- If **no related resources** → run [discover-related-resources.md](..\u002Fshared\u002Fdiscover-related-resources.md) to find downstream App Insights resources. This uses 4 targeted strategies (same resource group, dependency IKey correlation, shared workspace, local config scan).\n\n> **AI agent workloads**: For AI agent scenarios, dependency telemetry often has `target=unknown` (type=AI), making dependency-based discovery ineffective. The **local config scan** (strategy 3d) is typically the most reliable — tool endpoints and connection strings are usually in the source code. Also note that downstream resources may be in a **different subscription** than the agent — the discovery script uses cross-subscription Resource Graph queries to handle this.\n\nAfter discovery, confirm the list of resources with the user. Each resource should have a role label (e.g., \"Agent host\", \"Tool: SearchAPI\").\n\n### 4. Fetch operation context from primary resource\n\nQuery the primary App Insights resource for the full trace of the given operation ID. This establishes the baseline view of the distributed operation.\n\n> ⚠️ Before running queries, review [az CLI query pitfalls](..\u002Fshared\u002Faz-cli-query-pitfalls.md).\n\n#### 4a. Query requests, dependencies, and exceptions for the operation\n\n```powershell\n$resourceId = \"\u003CPRIMARY_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n# Fetch all telemetry for this operation: requests, dependencies, exceptions, traces\n$query = \"union requests, dependencies, exceptions, traces | where operation_Id == '$operationId' | project timestamp, itemType, name, duration, resultCode, target, type, operation_ParentId, id, problemId, message | order by timestamp asc\"\n\n$result = az monitor app-insights query `\n  --apps \"$resourceId\" `\n  --analytics-query \"$query\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -ne 0) {\n  Write-Host \"ERROR: Query failed for primary resource.\"\n  Write-Host $result\n} else {\n  $parsed = $result | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  Write-Host \"Found $($rows.Count) telemetry item(s) for operation $operationId in primary resource\"\n}\n```\n\n#### 4b. If using agentic-optimization — also fetch agent-specific context\n\nIf the operation originated from an AI agent analysis (e.g., flagged by the `agentic-optimization` skill), also run:\n\n```powershell\n# Use aira.exe response-context for richer agent-specific context\n$token = (az account get-access-token --resource \"https:\u002F\u002Fapi.applicationinsights.io\" --query accessToken -o tsv)\n\n$scriptDir = \"$PSScriptRoot\\..\\agentic-optimization\\scripts\"\n$exePath = Join-Path $scriptDir \"aira.exe\"\n\n& $exePath response-context `\n  -s \"$subscriptionId\" -g \"$resourceGroup\" -c \"$componentName\" `\n  --access \"$token\" `\n  --response-id \"$operationId\" `\n  -o json\n```\n\n> This step is optional — skip it if the operation is not from an AI agent workload or if `aira.exe` is not available.\n\n### 5. Correlate across downstream resources\n\nFor each related resource in the investigation notes, query for telemetry correlated to the same operation ID. The Application Insights SDK propagates operation IDs across service boundaries when distributed tracing is enabled.\n\n```powershell\n$relatedResourceId = \"\u003CRELATED_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n$query = \"union requests, dependencies, exceptions, traces | where operation_Id == '$operationId' | project timestamp, itemType, name, duration, resultCode, target, type, operation_ParentId, id, problemId, message | order by timestamp asc\"\n\n$result = az monitor app-insights query `\n  --apps \"$relatedResourceId\" `\n  --analytics-query \"$query\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -eq 0) {\n  $parsed = $result | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  Write-Host \"Found $($rows.Count) telemetry item(s) in resource: \u003CRESOURCE_NAME>\"\n} else {\n  Write-Host \"WARNING: Query failed for resource \u003CRESOURCE_NAME>. The operation may not have reached this service.\"\n}\n```\n\nRun this for each related resource. Collect all results.\n\nAdditionally, for each related resource that has telemetry for this operation:\n- **Check for profiler traces** — query `customEvents` for `ServiceProfilerSample` events covering the operation's time window. If found, note this for the user — they can use `get-profile-hotpath` for method-level analysis.\n- **Check for exceptions** — highlight any exceptions correlated to the operation.\n\n```powershell\n$relatedResourceId = \"\u003CRELATED_RESOURCE_ID>\"\n$operationId = \"\u003COPERATION_ID>\"\n\n# Derive the operation's time window from the telemetry fetched above.\n# Use the min\u002Fmax timestamps from the operation's events, with a 2-minute buffer\n# on each side to account for profiler sampling intervals.\n# $operationStart and $operationEnd should be ISO 8601 UTC strings computed from\n# the earliest and latest timestamps in the operation's telemetry results.\n$operationStart = \"\u003CISO 8601 UTC — earliest event timestamp minus 2 minutes>\"\n$operationEnd = \"\u003CISO 8601 UTC — latest event timestamp plus 2 minutes>\"\n\n# Check for profiler coverage in this time window\n$profilerQuery = \"customEvents | where name == 'ServiceProfilerSample' | where timestamp between (datetime('$operationStart') .. datetime('$operationEnd')) | take 1\"\n\n$profilerResult = az monitor app-insights query `\n  --apps \"$relatedResourceId\" `\n  --analytics-query \"$profilerQuery\" `\n  --offset \"P7D\" `\n  --output json 2>&1\n\nif ($LASTEXITCODE -eq 0) {\n  $parsed = $profilerResult | ConvertFrom-Json\n  $rows = $parsed.tables[0].rows\n  if ($rows.Count -gt 0) {\n    Write-Host \"Profiler trace available for this time window in resource: \u003CRESOURCE_NAME>\"\n  }\n}\n```\n\n### 6. Present cross-resource findings\n\nMerge all telemetry from the primary and related resources into a **unified timeline**. Present it to the user with:\n\n1. **Timeline view** — All events ordered by timestamp, annotated with which resource they came from and their role label:\n   ```\n   [00:00.000] Agent host     | REQUEST  POST \u002Fapi\u002Fchat              (2,450ms)\n   [00:00.050] Agent host     | DEPENDENCY  SearchAPI.Search         (1,200ms) → Tool: SearchAPI\n   [00:00.060] Tool: SearchAPI| REQUEST  POST \u002Fsearch                (1,180ms)\n   [00:00.070] Tool: SearchAPI| DEPENDENCY  Azure Cognitive Search   (950ms)\n   [00:01.300] Agent host     | DEPENDENCY  OpenAI.ChatCompletion   (800ms)\n   [00:02.200] Agent host     | REQUEST  POST \u002Fapi\u002Fchat completed    (2,450ms)\n   ```\n\n2. **Time breakdown** — Where was time spent? Show percentage per resource\u002Fdependency:\n   ```\n   Total: 2,450ms\n     SearchAPI call:     1,200ms (49%)  ← profiler available\n     OpenAI call:          800ms (33%)\n     Agent processing:     450ms (18%)\n   ```\n\n3. **Issues found** — Highlight:\n   - Exceptions or error status codes\n   - Dependencies with unusually high latency\n   - Missing telemetry gaps (time unaccounted for)\n   - Resources where the operation ID was NOT found (possible instrumentation gap)\n\n4. **Profiler availability** — For resources with profiler data covering this time window, note that method-level analysis is available.\n\n### 6b. Source code analysis for bottleneck tool calls\n\nWhen the cross-resource analysis identifies a **tool call or API call** as the dominant bottleneck (e.g., >50% of total operation time), scan the local codebase for the tool's implementation to identify the root cause.\n\nThis is especially valuable for AI agent workloads where the agent and its tools are often in the same repository.\n\n1. **Identify the tool name** from the telemetry (e.g., `execute_tool remote_openapi.GetUserFunc_GetUsers`)\n2. **Search the codebase** for the function implementation — look for matching function names, API route definitions, or OpenAPI operation IDs\n3. **Examine the implementation** for common bottlenecks:\n   - Slow SQL queries (missing indexes, N+1 queries, `WAITFOR DELAY`, full table scans)\n   - Unoptimized external API calls (missing caching, sequential instead of parallel calls)\n   - Large data transfers (returning all rows without pagination)\n   - Blocking I\u002FO (synchronous calls in async contexts)\n4. **Present findings** to the user with the specific code location and a concrete optimization recommendation\n\n> If the source code is not available in the working directory, inform the user and suggest they provide the repository path or examine the code manually.\n\n### 7. Suggest next steps\n\nBased on the findings, offer actionable follow-ups:\n\n- **Profiler deep-dive**: If a downstream resource has profiler data (detected in step 5's profiler check) → offer to invoke `get-profile-hotpath` immediately, passing the trace location ID from the `ServiceProfilerSample` event's `customDimensions.ServiceProfilerContent` field. This provides method-level call tree analysis without requiring the user to switch skills manually.\n- **Performance optimization**: If a downstream resource shows high latency → suggest `perf-optimization` targeting that resource\n- **Code optimizations**: If a downstream resource has Code Optimization recommendations → suggest fetching them\n- **Compare agent versions**: If the issue correlates with a specific agent version → suggest `aira.exe compare-versions`\n- **Widen investigation**: If the operation ID wasn't found in some related resources → the trace may not propagate there; suggest checking instrumentation or trying a different operation\n\n## Tips\n\n- Start with the primary resource context (step 4) before querying downstream resources — this gives you the dependency call graph to guide which resources matter most.\n- Not all related resources will have telemetry for a given operation. This is expected — the agent may not call every downstream service on every request.\n- If distributed tracing headers aren't propagated, the operation ID won't match across resources. In this case, fall back to time-based correlation (query by timestamp range instead of operation ID).\n- The timeline view is most useful when presented as a compact table or tree. Avoid overwhelming the user with raw telemetry — summarize and highlight.\n\n## References\n\n- [Discover Related Resources](..\u002Fshared\u002Fdiscover-related-resources.md)\n- [Investigation Notes](..\u002Fshared\u002Finvestigation-notes.md)\n- [az CLI Query Pitfalls](..\u002Fshared\u002Faz-cli-query-pitfalls.md)\n- [Standard Skill Preamble](..\u002Fshared\u002Fstandard-skill-preamble.md)\n- [Resolve App ID](..\u002Fshared\u002Fresolve-app-id.md)\n",{"name":5,"category":39,"description":7},"investigating","main","1408c23355d5bcd576aa09a262d3617408a39ff1","skills\u002Fdeep-analysis",4,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-06-18 06:39:50",{"source":9,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add microsoft\u002Fcode-optimizations-skills --skill deep-analysis",{"tool":55,"command":56},"bunx","bunx skills add microsoft\u002Fcode-optimizations-skills --skill deep-analysis",{"tool":58,"command":59},"pnpm","pnpm dlx skills add microsoft\u002Fcode-optimizations-skills --skill deep-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdeep-analysis\u002FSKILL.md",true,[],[64,80,93,105,117,130],{"skillNo":65,"name":66,"nameZh":67,"description":68,"descriptionZh":69,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":70,"categories":71,"keywords":76,"publishedAt":34},"01M69B9PQSRYEQ57P4DH390F4E","perf-optimization","性能瓶颈分析与优化","Guide for analyzing performance issues based on profiler and code optimizations, including CPU, latency, and throughput. Use this when asked to investigate performance bottlenecks or optimize application performance.","基于性能分析器（profiler）和代码优化来分析性能问题的指南，涵盖 CPU、延迟和吞吐量。当被要求排查性能瓶颈或优化应用性能时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fperf-optimization\u002FSKILL.md",[72,75],{"categoryNo":73,"categoryName":74,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[77,78,79],"perf","perf optimization","performance",{"skillNo":81,"name":82,"nameZh":83,"description":84,"descriptionZh":85,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":90,"publishedAt":34},"01M69B9M9F4CRY6M658D9G6M3J","get-snapshot-debug-info","快照调试器异常信息获取","Fetch exception details, call stack, and variable values from an Application Insights Snapshot Debugger snapshot. Use this when asked to inspect a snapshot, view exception info, debug an exception, or see variable values from a crash.","从 Application Insights Snapshot Debugger 快照中获取异常详情、调用堆栈和变量值。当被要求检查快照、查看异常信息、调试异常或查看崩溃时的变量值时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fget-snapshot-debug-info\u002FSKILL.md",[88,89],{"categoryNo":73,"categoryName":74,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[91,92],"debug","get snapshot debug info",{"skillNo":94,"name":95,"nameZh":96,"description":97,"descriptionZh":98,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":99,"categories":100,"keywords":103,"publishedAt":34},"01M69B9JD8S30MKR1NSYYTYDWY","get-profile-hotpath","应用洞察 Profiler 热点路径分析","Fetch and display the hot path from an Application Insights Profiler trace. Use this when asked to get the profiler hot path, call tree, or trace analysis for an App Insights resource.","从 Application Insights Profiler 跟踪中获取并显示热点路径。当被要求获取 App Insights 资源的热点路径、调用树或跟踪分析时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fget-profile-hotpath\u002FSKILL.md",[101,102],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[104],"get profile hotpath",{"skillNo":106,"name":107,"nameZh":108,"description":109,"descriptionZh":110,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":111,"categories":112,"keywords":115,"publishedAt":34},"01M69B9GXTJCY8PWGB5XX4AMBW","error-exploration","Application Insights 错误排查","Explore errors in Application Insights — exceptions, failed requests, and failed dependencies. Use this when asked to find errors, investigate failures, identify reliability issues, or recommend which errors to fix.","在 Application Insights 中排查错误——异常、失败的请求以及失败的依赖项。当用户要求查找错误、调查故障、识别可靠性问题，或推荐应优先修复的错误时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-exploration\u002FSKILL.md",[113,114],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[116],"error exploration",{"skillNo":118,"name":119,"nameZh":120,"description":121,"descriptionZh":122,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":123,"categories":124,"keywords":127,"publishedAt":34},"01M69B9FA96KZ9KH398YZM9Z68","enable-snapshot-debugger","启用 Application Insights 快照调试器","Guide users through enabling the Application Insights Snapshot Debugger for .NET on their platform. Use this when asked to enable the snapshot debugger, set up snapshot collection, or when snapshot data is missing.","指导用户在其平台上为 .NET 启用 Application Insights Snapshot Debugger。当用户要求启用快照调试器、设置快照收集，或快照数据缺失时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fenable-snapshot-debugger\u002FSKILL.md",[125,126],{"categoryNo":73,"categoryName":74,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[128,129],"enable snapshot debugger","setup",{"skillNo":131,"name":132,"nameZh":133,"description":134,"descriptionZh":135,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":136,"categories":137,"keywords":142,"publishedAt":34},"01M69B9D7V4VPRG1BNVS7GF9GF","enable-profiler","启用 Application Insights 性能分析器","Guide users through enabling the Application Insights Profiler for .NET on their platform. Use this when asked to enable the profiler, set up profiling, or when profiler data is missing.","指导用户在其平台上为 .NET 启用 Application Insights Profiler。当用户要求启用分析器、设置性能分析，或分析器数据缺失时使用此技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fcode-optimizations-skills\u002Fblob\u002Fmain\u002Fskills\u002Fenable-profiler\u002FSKILL.md",[138,141],{"categoryNo":139,"categoryName":140,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD3B3T8FK02S5JVCZA1M","运维监控与告警",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[143,129],"enable profiler"]