AGENT SKILL

skill-kql-queries

[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.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 5.4k
Forks
714

01 前言 Front Matter

name
skill-kql-queries
description
[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.
user-invocable
false
disable-model-invocation
false

03 SKILL.md 正文

Koji KQL Log Queries

Tools

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 pod namespace

Koji pods run in the default namespace. Always filter:

  • Namespace == "default" (KubePodInventory, KubeEvents)
  • PodNamespace == "default" (ContainerLogV2)
  • Combine with: Name startswith "koji-" or PodName startswith "koji-"

Query reference

Pod health and status

KubePodInventory
| where Namespace == "default"
| where Name startswith "koji-"
| summarize arg_max(TimeGenerated, *) by Name
| project TimeGenerated, Name, ContainerStatus, ContainerRestartCount, PodRestartCount
| order by Name asc

Container errors (all Koji pods)

ContainerLogV2
| 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 50

Koji Hub logs

ContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-hub"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 100

Koji Builder logs

ContainerLogV2
| where PodNamespace == "default"
| where PodName startswith "koji-builder"
| project TimeGenerated, PodName, LogMessage
| order by TimeGenerated desc
| take 100

Node resource usage

Perf
| 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 asc

Pod restarts

KubePodInventory
| where Namespace == "default"
| where Name startswith "koji-"
| summarize MaxRestarts = max(ContainerRestartCount) by Name, ContainerName, ContainerStatus
| where MaxRestarts > 0
| order by MaxRestarts desc

Kubernetes warning events

KubeEvents
| 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 50

KubeEvents may be empty under Group-Default DCR preset. Fall back to KubePodInventory restart counts.

Build job activity

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 100

04 同仓库更多 Skills

microsoft
microsoft/azurelinux

skill-metrics

[Skill] metrics, azure-monitor, aks - Query Azure Monitor metrics for Koji AKS node CPU, memory, disk usage, and pod readiness.

Skill与智能体开发
★ 5.4k
microsoft
microsoft/azurelinux

skill-mass-triage

[Skill] Batch-triage build failures from a JSON results file — diagnose with parallel sub-agents, bucketize by root cause, and produce a consolidated summary. Use when asked to triage a Koji results file. Triggers: batch triage, mass triage, triage results file, bucketize failures.

Skill与智能体开发
★ 5.4k
microsoft
microsoft/azurelinux

skill-koji-triage

[Skill] Examine Koji builds, fetch task info and logs from the Koji Web UI, identify failures, and provide root cause analysis. Use when triaging Koji build failures, investigating failed tasks, downloading build logs, or searching for broken packages. Triggers: koji failure, koji build failed, koji task, koji log, koji triage, build failure analysis.

Skill与智能体开发
★ 5.4k
microsoft
microsoft/azurelinux

skill-fedora-mirror-injections

[Skill] Diagnose Azure Linux Stage 1 (bootstrap-mirror) BuildRequires resolution failures and backfill missing RPMs into the prod Fedora updates mirror via the azl-infra injections file. Use when triaging stage-1 / azl4-bootstrap-mirror build failures, finding dependency gaps in the Fedora mirror, deciding whether a failure is a real mirror gap vs a transient timeout or a spec bug, adding entries to azl4-stage1-injections.yaml, or opening a PR with mirror injections. Triggers: bootstrap-mirror, stage 1 build failure, fedora mirror gap, missing BuildRequires, nothing provides crate, no match for argument, injections file, azl4-stage1-injections, mirror injection.

Skill与智能体开发
★ 5.4k
microsoft
microsoft/azurelinux

skill-deployment-context

[Skill] deployment context, aks, azure, koji - Resolve Koji AKS deployment context -- resource group, cluster name, subscription, Log Analytics workspace, and monitoring resource names from deployment_summary.yaml when available, or discover them dynamically from Azure.

Skill与智能体开发
★ 5.4k
microsoft
microsoft/azurelinux

skill-aks-health

[Skill] aks, aks health, cluster health, node pool, activity logs - Inspect Koji AKS cluster health, node pool status, autoscaling, activity logs, deployment failures, and Azure control-plane operations.

Skill与智能体开发
★ 5.4k