Forum Discussion
Join query question.
Not sure which solution you have on boarded. If its ContainerInsights solution , then the Table you can look at is KubePodInventory Table instead of the ContainerTable in the query.
Here is the sample query which you can use to calculate how long container in waiting state
ContainerTable
| where ContainerStatus =~ "waiting"
| summarize arg_max(TimeGenerated, ContainerStatus) by ContainerID
| project LastWaitingTime= TimeGenerated, ContainerID
| join kind=inner (
ContainerTable
| where ContainerStatus =~ "running"
| summarize arg_max(TimeGenerated, ContainerStatus) by ContainerID
| project LastRunningTime= TimeGenerated, ContainerID
) on ContainerID
| project ContainerID, LastRunningTime, LastWaitingTime, TotalWaitTime = (LastWaitingTime - LastRunningTime)
Please feel free to ping me if you need any further help on this.