[Skill] kql, queries, log analytics, container logs - KQL query templates for Koji container logs, pod errors, restarts, Kubernetes events, build job activity, and node resource usage via Log Analytics.
67
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.github/skills/skill-kql-queries/SKILL.md| Tool | Purpose |
|---|---|
monitor_workspace_log_query | KQL queries across entire Log Analytics workspace |
monitor_resource_log_query | KQL queries scoped to a specific resource |
monitor_table_list | List available tables in the workspace |
Koji pods run in the default namespace. Always filter:
Namespace == "default" (KubePodInventory, KubeEvents)PodNamespace == "default" (ContainerLogV2)Name startswith "koji-" or PodName startswith "koji-"KubePodInventory
| where Namespace == "default"
| where Name startswith "koji-"
| summarize arg_max(TimeGenerated, *) by Name
| project TimeGenerated, Name, ContainerStatus, ContainerRestartCount, PodRestartCount
| order by Name ascContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-"
| where LogLevel == "error" or LogMessage contains "ERROR" or LogMessage contains "Traceback"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 50ContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-hub"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 100ContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-builder"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 100Perf
| where ObjectName == "K8SNode"
| where CounterName in ("cpuUsageNanoCores", "cpuCapacityNanoCores", "memoryWorkingSetBytes", "memoryCapacityBytes")
| summarize AvgValue=avg(CounterValue) by Computer, CounterName
| evaluate pivot(CounterName, take_any(AvgValue))
| extend CPUPercent = round(cpuUsageNanoCores / cpuCapacityNanoCores * 100, 1),
MemPercent = round(memoryWorkingSetBytes / memoryCapacityBytes * 100, 1),
MemUsedGB = round(memoryWorkingSetBytes / 1073741824, 1),
MemCapGB = round(memoryCapacityBytes / 1073741824, 1)
| project Computer, CPUPercent, MemPercent, MemUsedGB, MemCapGB
| order by Computer ascKubePodInventory
| where Namespace == "default"
| where Name startswith "koji-"
| summarize MaxRestarts = max(ContainerRestartCount) by Name, ContainerName, ContainerStatus
| where MaxRestarts > 0
| order by MaxRestarts descKubeEvents
| where Namespace == "default"
| where Name startswith "koji-"
| where Reason in ("BackOff", "Unhealthy", "Failed", "Killing", "OOMKilling")
| project TimeGenerated, Name, Reason, Message
| order by TimeGenerated desc
| take 50KubeEvents may be empty under Group-Default DCR preset. Fall back to KubePodInventory restart counts.
ContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-builder"
| where LogMessage contains "build" or LogMessage contains "task"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 1009e308ff
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.