해당 데이터는 LogManagement 섹션의 Perf 테이블에 있습니다.
컨테이너에 대해 Azure Monitor에서 로그를 쿼리하는 방법 의 설명서 페이지 에는 시작할 수있는 예제 쿼리가 있습니다.
Querying this data takes a bit of parsing, because the Computer
field always shows the name of the node the data was gathered from, not the pod. In order to get pod/container specific data, you have to look at records with ObjectName == 'K8SContainer'
and parse the InstanceName
field, which contains the data you need. InstanceName is built like this: /subscriptions/SUBSCRIPTIONID/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.ContainerService/managedClusters/CLUSTERNAME/PODUID/CONTAINERNAME
. Given that data, we can parse out the PodUid
and join with KubePodInventory to get the identifying information for that Pod
.
Here's an example query:
Perf
| where ObjectName == 'K8SContainer' and TimeGenerated > ago(1m)
| extend PodUid = tostring(split(InstanceName, '/', 9)[0]), Container = tostring(split(InstanceName, '/', 10)[0])
| join kind=leftouter (KubePodInventory | summarize arg_max(TimeGenerated, *) by PodUid) on PodUid
| project TimeGenerated, ClusterName, Namespace, Pod = Name, Container, PodIp, Node = Computer, CounterName, CounterValue
This query produces a result like this, which should contain the data you need:
참고로이 Computer
필드에는 OMS 에이전트가 실행중인 노드 이름이 항상 표시됩니다. 노드 수준에서 통계를 수집하지만 이러한 통계에는 cgroup
네임 스페이스가 네트워킹, 파일 시스템 및 프로세스를 분리하는 데 사용되는 방식과 같이 일반적으로 컨테이너 뒤의 CPU / 메모리 격리 및 제한 기술인 각 에 대한 메모리 및 CPU 사용량 이 포함됩니다. ID.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다