# Analyze metrics from instrumentation by using AI agents

Interpret telemetry, trace relationships and generated queries
Analyze infrastructure and application signals by collection layer, identity and interval. Follow trace and parent relationships without inventing missing spans, preserve complete Copilot records and their sharing boundaries, and inspect AI-generated KQL against actual schema, time boundaries and returned evidence.

Author: LearningPathX Editorial Team
Content version: 1.0
Published: 2026-12-05T06:02:54.079858+00:00
HTML: https://learningpathx.com/material/AZ-401/analyze-metrics-from-instrumentation-by-using-ai-agents.html

Knowledge domain: Implement an instrumentation strategy (15–20%)
Tags: Evidence Validation / Monitoring / Information Provenance

## Analyze metrics from instrumentation by using AI agents

## Learning objectives

* Interpret infrastructure and application signals within their actual collection scope.
* Reconstruct a distributed operation using trace and parent relationships.
* Identify, retrieve and manage the correct Copilot session records.
* Review natural-language log queries against real schema, time boundaries and returned evidence.

## Start at the right collection layer

Record resource identity, metric namespace, unit, aggregation and interval before diagnosing a bottleneck. VM host platform metrics provide CPU, network and disk signals. Guest memory does not automatically appear in that host overview. Missing memory is a collection gap, not evidence of spare memory. Enable supported guest/VM insights collection where needed and distinguish the current Azure Monitor Agent path from legacy diagnostics-extension surfaces.

For one VM, Overview shows host trends; Metrics selects counters and aggregation; configured Insights Performance shows guest performance; Logs queries scoped collected data. Activity log describes administrative changes such as starts, stops and configuration, not process CPU consumption. VM insights Map requires the relevant process/dependency collection. Comparing several machines needs the broader authorized workspace view; one VM can conceal the other involved service.

Align instance and time before drawing conclusions. Sustained CPU pressure on the affected instance during the latency interval supports a compute hypothesis, while a coarse average can hide spikes or another hot instance. Disk activity alone does not prove saturation, nor do network bytes prove loss or failed connections. Inspect the relevant counters/dependencies and available connection monitoring before choosing scaling, code or connectivity work.

Provide an agent with the actual resource IDs, observed values, collection coverage and interval. Verify its cited units and aggregation against the portal. Preserve absent counters and query errors. After an authorized correction, compare equivalent windows and populations; a quieter period does not independently prove repair.

## Build a supported application hypothesis

Use Application Insights request, dependency, failure and performance data for the correct application/role and interval. Inspect rate, duration and failure dimensions, then drill into affected operations and representative transactions. Compare their dependencies and exceptions rather than combining unrelated ranges.

Application Map shows instrumented components and observed relationships. An HTTP dependency to another endpoint does not prove that endpoint exports full server telemetry. Role/resource naming can merge or separate components. A missing node can reflect absent instrumentation or propagation rather than an absent service. Inspect node/edge identities and their performance/failure details before attributing ownership.

In an illustrative slow-checkout case, the checkout request and its payment dependency share the affected interval and the dependency span is slow. That supports investigation of the payment dependency. A database existing in the same deployment does not prove it caused the delay. Compare successful and failed traces, recent changes and the actual dependency span. If the external endpoint has no server instrumentation, report caller-observed duration while leaving its internal cause unknown.

AI can correlate observations and propose a discriminating next query. Preserve original filters, observations and contradictory evidence. The useful conclusion states which operation/dependency supports the hypothesis, what remains unobserved and which authorized observation would distinguish alternatives. Correlation is neither causal proof nor permission to modify production.

## Follow trace relationships across service boundaries

A distributed trace groups an operation across services. In Application Insights, `operation_Id` correlates the operation, while request/dependency identifiers and parent relationships form its tree. W3C `traceparent` carries trace/span context; `tracestate` carries additional context. The root trace ID is not every span's ID.

Instrument participants and propagate context through supported calls. In transaction diagnostics, select an affected request, inspect dependencies and follow correlated downstream requests. Query each relevant authorized telemetry store if the operation crosses resources. One application-resource query need not contain the entire distributed operation.

For an illustrative request A → dependency B → downstream request C, a common trace identity connects the operation and parent links establish relationships. If C is absent, investigate instrumentation, context propagation and telemetry availability. Do not invent C from B's dependency line. Likewise, overlapping timestamps do not combine two requests with different trace identities.

Map topology/aggregate relationships and one transaction's timeline answer different questions. Validate propagation and storage coverage before declaring that a gap is a network outage or a long operation identifies a particular internal code defect.

## Preserve the right Copilot records

Session data can include prompts, responses, tools and file changes. Execution location, storage, account synchronization and sharing are independent. A cloud audit event is not a complete transcript. A synced local session is not automatically shared with colleagues.

The adopted CLI/App documentation keeps complete local records under `~/.copilot/session-state/` plus a subset in a SQLite history store used by queries and `/chronicle`. IDE storage is specific to the IDE. After restoring full local session files, `/chronicle reindex` rebuilds the index; the index alone cannot replace the records. Verify the session and repository identity before export or sharing.

Local CLI/App syncing is default subject to policy and the supported `remoteExport` setting. Business/Enterprise's **Store local sessions in the Cloud** policy must allow at least View from cloud; disabled or unconfigured policy leaves local-only storage. Local and synchronized sessions are unshared by default. An administrator allowing sync does not thereby gain every user's personal session content. Sharing an individual local session gives supported repository-access recipients view-only access, not inclusion in their own history queries.

Cloud Actions uses ephemeral execution environments, but logs remain on GitHub and are shared by default with repository-access users. Cloud sandbox sessions preserve a stopped snapshot for resumption and are unshared by default. Stopping execution therefore does not establish deleted records.

| Surface/record | Adopted lifecycle behavior |
| --- | --- |
| Local CLI | Share and delete, but no local archive; synced deletion asks whether to remove the synced copy. |
| Local App | Share, archive and delete; local deletion immediately removes its synced copy. |
| Cloud Actions session on GitHub | Archive, not delete, in the cited matrix. |
| Sandbox and synced local records on GitHub | Support deletion. |

Archive hides a record from active lists rather than erasing it. Preserve needed authorized evidence before deletion, without inventing a universal retention duration from this capability matrix. History queries may send relevant prompts/context/responses to the model. Treat export/sharing as disclosure: minimize sensitive material and verify destination access.

## Turn a log question into a checkable query

Supply the resource/workspace, real table/schema, time window and operational question. Inspect generated KQL for those boundaries and actual columns, execute only with authorized read access, then inspect rows and errors. Plausible syntax or fluent explanation is not a measured result.

KQL operates on tabular populations. `where` filters, `project` chooses columns, `count` counts current rows and `sort by` orders them. Filter before counting. `StormEvents` is a tutorial dataset, not an assumed application table or production evidence for this lesson.

An illustrative query against the adopted audit table is:

```kusto
AzureDevOpsAuditing
| where TimeGenerated between (datetime(2026-11-01T00:00:00Z) .. datetime(2026-11-01T01:00:00Z))
| project TimeGenerated
| sort by TimeGenerated asc
```

This returns timestamps in an inclusive one-hour interval, not actor details or full events. Confirm table/column types and replace the dates for real use. Expected boundary cases are:

| Illustrative input | Expected selection |
| --- | --- |
| 2026-10-31T23:59:59Z | Excluded: before the lower boundary |
| 2026-11-01T00:00:00Z | Included: lower boundary |
| 2026-11-01T00:30:00Z | Included |
| 2026-11-01T01:00:00Z | Included: upper boundary |
| 2026-11-01T01:01:00Z | Excluded: after the upper boundary |
| Required interval input missing | Resolve the missing scope before forming a reliable measurement. |

For adjacent hourly windows, use `TimeGenerated >= start` and `TimeGenerated < end` to avoid counting the shared boundary twice. Appending `| count` after the filter counts matching rows, not distinct incidents or proof of complete ingestion. No-row results can mean an empty interval, wrong scope/filter, delayed ingestion or missing collection. Compare a known event and ingestion health rather than inventing an explanation. Preserve errors and partial coverage, and never adopt a tutorial's published row count as your execution result. The displayed query was not run against a service.

## Summary

Analyze signals through their collection layer, identity, unit and interval. Use trace relationships and actual telemetry to bound hypotheses, keeping missing observations explicit. Manage complete session records independently from indexes and sharing. Review AI-generated KQL against the real schema and boundary cases, then report only what its authorized execution actually returned.
