aks/logs for reporting performance at namespace level

Niren Adhikary (NAD) 146 Reputation points
2022-11-29T09:21:57.273+00:00

Hi All,

I would to extract a report for the AKS performance for last 7days. I believe the easiest way to do this would be using KQL query in the log analytics.

I tried to capture this manually from the portal but it becomes impossible because the page loads very slow as we have high data and number of workloads.

265165-image.png

265173-image.png

I did a query in log analytics on container CPU and Container Memory but could not find all the data. Could you please guide or help with custom query to retrieve/extract the information below ?

265136-image.png

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,023 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,992 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 23,051 Reputation points
    2022-12-05T12:26:21.26+00:00

    Hi @Niren Adhikary (NAD) ,

    Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question. There isn't any predefined custom query for the requirement you have here, However, based on the counters you specified, "Perf" table from Azure Monitor Logs table reference for Kubernetes helps here.

    It's often useful to build queries that start with an example or two and then modify them to fit your requirements. To help build more advanced queries, you can experiment with the following sample queries.

    You can use the below two queries

    Perf
    | where ObjectName == "K8SContainer" and CounterName == "cpuUsageNanoCores"
    | summarize AvgCPUUsageNanoCores = avg(CounterValue) by bin(TimeGenerated, 30m), InstanceName

    Perf
    | where ObjectName == "K8SContainer" and CounterName == "memoryRssBytes"
    | summarize AvgUsedRssMemoryBytes = avg(CounterValue) by bin(TimeGenerated, 30m), InstanceName

    Reference: Get started with log queries in Azure Monitor

    Hope this helps.
    If you need further help on this, tag me in a comment.
    If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.

    0 comments No comments