dt-alerting
End-to-end Dynatrace alerting lifecycle — anomaly detector setup and model selection (static threshold, adaptive baseline,…
Kubernetes cluster, pod, node, and workload monitoring. Use when analyzing K8s health, resource optimization, pod failures, OOMKills, scheduling, or security posture. Also use for Kubernetes operational events like pod restarts, OOM events, evictions, and cluster event history.
$ npx -y skills add Dynatrace/dynatrace-for-ai --skill dt-obs-kubernetes --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dt-obs-kubernetesContext preview
The summary Claude sees to decide when to auto-load this skill.
Kubernetes cluster, pod, node, and workload monitoring. Use when analyzing K8s health, resource optimization, pod failures, OOMKills, scheduling, or security posture. Also use for Kubernetes operational events like pod restarts, OOM events, evictions, and cluster event history.
name: dt-obs-kubernetes description: >- Kubernetes cluster, pod, node, and workload monitoring. Use when analyzing K8s health, resource optimization, pod failures, OOMKills, scheduling, or security posture. Also use for Kubernetes operational events like pod restarts, OOM events, evictions, and cluster event history. Trigger: "Kubernetes pods", "K8s cluster health", "OOMKill", "pod restarts", "container CPU", "namespace resource usage", "over-provisioned pods", "privileged containers", "pod placement", "K8s node capacity", "running containers by cluster", "workload scheduling", "pod evictions", "K8s labels and annotations", "kubernetes events", "pod restart events", "OOM events", "K8s event history". Do NOT use for explaining existing queries, product documentation questions, AWS-specific resource queries, service-level RED metrics, distributed tracing, or log analysis — use the relevant skill instead. license: Apache-2.0
Monitor and analyze Kubernetes infrastructure using Dynatrace DQL. Query cluster resources, monitor workload health, analyze pod placement, optimize costs, and assess security posture.
1. **Cluster Inventory** → `references/cluster-inventory.md` - Clusters, namespaces, resource distribution 2. **Node Monitoring** - Node capacity, CPU/memory usage, pod density 3. **Pod Monitoring** - Pod CPU, memory, lifecycle events 4. **Workload Monitoring** - Deployment, StatefulSet, DaemonSet resources
1. **Configuration Analysis** → `references/labels-annotations.md` - Parse k8s.object, labels, annotations 2. **Scheduling & Placement** → `references/pod-node-placement.md` - Node selectors, affinity, taints, HA 3. **Cost Optimization** - Right-sizing, waste detection, efficiency scoring 4. **Security & Compliance** - Privileged containers, security contexts
**Workloads:** `K8S_DEPLOYMENT`, `K8S_STATEFULSET`, `K8S_DAEMONSET`, `K8S_JOB`, `K8S_CRONJOB`, `K8S_HORIZONTALPODAUTOSCALER` **Infrastructure:** `K8S_CLUSTER`, `K8S_NAMESPACE`, `K8S_NODE`, `K8S_POD` **Configuration:** `K8S_SERVICE`, `K8S_CONFIGMAP`, `K8S_SECRET`, `K8S_PERSISTENTVOLUMECLAIM`, `K8S_PERSISTENTVOLUME`, `K8S_INGRESS`, `K8S_NETWORKPOLICY`
> **Note:** HPA, Job, CronJob, and configuration entity types are listed for > inventory queries only. For HPA scaling analysis see `references/workload-health.md`; > for PVC/PV see `references/pv-pvc.md`; for Ingress/NetworkPolicy see the > corresponding reference files.
**smartscapeNodes** - Query K8s entities (current state, no time range needed):
smartscapeNodes K8S_POD | filter k8s.namespace.name == "production" | fields k8s.cluster.name, k8s.pod.name
**timeseries** - Monitor metrics over time (always specify a `from:` range):
timeseries cpu = sum(dt.kubernetes.container.cpu_usage),
by: {k8s.pod.name, k8s.namespace.name},
from: now()-1h
| fieldsAdd avg_cpu = arrayAvg(cpu)> `timeseries` returns each metric as a time-bucket array. To collapse it to a > scalar in a downstream `fieldsAdd`, use `arrayAvg(series)` or `arraySum(series)` > — calling `avg()` or `sum()` on a series field outside the `timeseries {}` block > is not supported.
**fetch logs** - Analyze log events:
fetch logs | filter k8s.namespace.name == "production" and loglevel == "ERROR"
**`k8s.workload.kind` values** (always lowercase in DT — not Pascal-case as in the K8s API): `"deployment"`, `"statefulset"`, `"daemonset"`, `"replicaset"`, `"job"`, `"cronjob"`
**`k8s.object` availability:**
| Entity type | `k8s.object` available? | |---|---| | `K8S_POD` | Yes | | `K8S_NAMESPACE` | Yes | | `K8S_NODE` | Yes | | Workload types (`K8S_DEPLOYMENT`, etc.) | Yes | | `K8S_CLUSTER` | **No** |
**CPU:** `dt.kubernetes.container.cpu_usage`, `cpu_throttled`, `limits_cpu`, `requests_cpu` **Memory:** `dt.kubernetes.container.memory_working_set`, `limits_memory`, `requests_memory` **Operations:** `dt.kubernetes.container.restarts`, `oom_kills` **Node:** `dt.kubernetes.node.pods_allocatable`, `cpu_allocatable`, `memory_allocatable`, `dt.kubernetes.pods`
> **Aggregation rule for requests/limits:** Always use `sum()` — never `avg()` — > when aggregating `requests_cpu`, `limits_cpu`, `requests_memory`, or > `limits_memory`. `avg()` returns a per-container average and silently > undercounts multi-container pods and multi-replica workloads. For DaemonSets > (one pod per node), this error is proportional to cluster size.
`K8S_POD` vs `CONTAINER`: these are different entity types in Dynatrace.
The smartscape edge is `CONTAINER --(is_part_of)--> K8S_POD`. To reach containers from a pod, traverse backward:
smartscapeNodes K8S_POD
| filter k8s.namespace.name == "<namespace>"
| traverse edgeTypes: {is_part_of}, targetTypes: {CONTAINER}, direction: backward, fieldsKeep: {id}
|Everything AI agents need to work with Dynatrace, starting with skills. Skills are portable knowledge packages following the Agent Skills open format. They give AI coding agents the domain-specific context to query, analyze, and interpret Dynatrace data.
End-to-end Dynatrace alerting lifecycle — anomaly detector setup and model selection (static threshold, adaptive baseline,…
Work with Dynatrace dashboards - create, modify, query, and analyze dashboard JSON including tiles, layouts, DQL queries,…
Work with Dynatrace notebooks - create, modify, query, and analyze notebook JSON including sections, DQL queries, and…
Core DQL syntax, pitfalls, query patterns, and query optimization. Load to write, build, fix, or OPTIMIZE a DQL query — prevents…
Dynatrace server-side JS runtime — function contract, runtime limits, Web APIs, Node.js modules, fetch with credential vault, and…
Migrate Dynatrace classic and Gen2 entity-based DQL to Smartscape equivalents. Covers three scenarios. (1) mass data queries…