Question 100 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 100 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are debugging an application that is running on Azure Kubernetes cluster named cluster1

The cluster uses Azure Monitor for containers to monitor the cluster.

The application has sticky sessions enabled on the ingress controller.

Some customers report a large number of errors in the application over the last 24 hours.

You need to determine on which virtual machines (VMs) the errors are occurring.

How should you complete the Azure Monitor query? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

let startTimestamp =

ago(1d)
since(1d)
totimespan(id)
date(now() - 1d)

let ContainerlDs = KubePodinventory
| where ClusterName == "Cluster1”

| vv

fork containeriDs
]where Container'D in (ContainerlDs)

restrict ContaineriD in (Containers)

join ContainerlD = = ContaineriDs.ContainerID
where TimeGenerated > startTimestamp
where LogEntrySource = = "stderr"

| vv
project by Computer
|summarize by Computer

partition count() by Computer
/summarize count() by Computer

Explanations

Answer Area

let startTimestamp =

ago(1d)
since(1d)
totimespan(id)
date(now() - 1d)

let ContainerlDs = KubePodinventory
| where ClusterName == "Cluster1”

| iv
top ContainerlD
union ContainerlD
‘sample ContainerlD
distinct ContainerlID
ContainerLog
| iv
fork containerIDs
|where ContainerlD in (ContaineriDs)
restrict ContaineriD in (ContainerlDs)
join ContaineriD ContainerlDs.ContainerlD
| where TimeGenerated > startTimestamp
| where LogEntrySource = = "stderr"
| iv
project by Computer
[summarize by Computer
partition count() by Computer
[summarize count() by Computer

Box 1: ago(1d) Box 2: distinct containerID - Box 3: where ContainerID in (ContainerIDs) Box 4: summarize Count by Computer Summarize: aggregate groups of rows Use summarize to identify groups of records, according to one or more columns, and apply aggregations to them.

The most common use of summarize is count, which returns the number of results in each group.

https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/get-started-queries https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/query-optimization