
Dt Obs Hosts
Inventory and analyze Kubernetes containers and hosts in Dynatrace Smartscape with ready-made DQL instead of guessing entity fields.
Overview
dt-obs-hosts is an agent skill for the Operate phase that supplies Dynatrace DQL patterns to inventory containers and analyze Kubernetes workload distribution in Smartscape.
Install
npx skills add https://github.com/dynatrace/dynatrace-for-ai --skill dt-obs-hostsWhat is this skill?
- DQL recipes for smartscapeNodes CONTAINER with cluster, namespace, and workload context
- Summaries for container counts per cluster and distinct namespaces
- Grouping by Kubernetes workload kind (daemonset, deployment, statefulset, job, cronjob, replicaset)
- Explicit note that container image name/version are not available in Smartscape queries
- Sorted, limited result sets (e.g. limit 100) for safe exploratory inventory
- Documents 6 Kubernetes workload kinds for grouping (daemonset, deployment, statefulset, job, cronjob, replicaset)
- Example inventory queries use limit 100 for bounded exploration
Adoption & trust: 670 installs on skills.sh; 87 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You run containers on Kubernetes in Dynatrace but lack quick, correct DQL to see what is deployed across clusters and namespaces.
Who is it for?
Indie operators who already use Dynatrace Smartscape and need Kubernetes container inventory and distribution queries during ongoing production care.
Skip if: Builders still picking observability stacks or anyone who needs container image name/version fields from Smartscape alone.
When should I use this skill?
You need Dynatrace Smartscape DQL for container overview, cluster distribution, or workload-type summaries on live Kubernetes hosts.
What do I get? / Deliverables
You get tested Smartscape queries for container lists, cluster rollups, and workload-type breakdowns you can run in Dynatrace immediately.
- Copy-paste DQL queries for container inventory and aggregations
- Guidance on Smartscape field limits (no image name/version in these queries)
Recommended Skills
Journey fit
Container and host observability is a production runbook task once workloads are live, so the canonical shelf is Operate. Smartscape inventory, cluster distribution, and workload-kind rollups are monitoring intelligence, not deploy or error triage alone.
How it compares
Reference DQL cookbook for Dynatrace Smartscape, not a generic Prometheus/Grafana dashboard generator.
Common Questions / FAQ
Who is dt-obs-hosts for?
Solo builders and small teams operating Kubernetes workloads monitored in Dynatrace who want agent-ready DQL for container inventory and cluster distribution.
When should I use dt-obs-hosts?
Use it in Operate → monitoring when auditing what containers exist per cluster, namespace, or workload kind, or when onboarding an agent to your Dynatrace entity model.
Is dt-obs-hosts safe to install?
It is documentation-style procedural knowledge; review the Security Audits panel on this catalog page before trusting third-party skill packages in your agent environment.
SKILL.md
READMESKILL.md - Dt Obs Hosts
# Container Monitoring Reference Container inventory, Kubernetes version management, and operator tracking with comprehensive lifecycle analysis. **Important Note:** Container image names and versions are NOT available in smartscape queries. Use container names and Kubernetes workload information for identification. --- ## Container Inventory ### All Containers Overview Fetch all containers with basic information: ```dql smartscapeNodes "CONTAINER" | fieldsAdd name, k8s.cluster.name, k8s.namespace.name, k8s.workload.name | sort name asc | limit 100 ``` Returns container instances with their Kubernetes context. ### Kubernetes Container Distribution Analyze container distribution across Kubernetes clusters: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.cluster.name) | fieldsAdd k8s.cluster.name, k8s.namespace.name | summarize container_count = count(), namespaces = countDistinct(k8s.namespace.name), by: {k8s.cluster.name} | sort container_count desc ``` ### Containers by Workload Type Group containers by Kubernetes workload kind: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.workload.kind) | fieldsAdd k8s.workload.kind | summarize container_count = count(), by: {k8s.workload.kind} | sort container_count desc ``` **Workload Types:** - `daemonset`: Node-level services - `deployment`: Standard deployments - `statefulset`: Stateful applications - `job`: Batch jobs - `cronjob`: Scheduled tasks - `replicaset`: Replica sets ### Containers by Namespace List containers grouped by Kubernetes namespace: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.namespace.name) | fieldsAdd k8s.namespace.name, k8s.cluster.name | summarize container_count = count(), by: {k8s.cluster.name, k8s.namespace.name} | sort k8s.cluster.name, container_count desc ``` ### Container Workload Distribution Analyze workloads across clusters: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.workload.name) | fieldsAdd k8s.cluster.name, k8s.workload.name, k8s.workload.kind | summarize container_count = count(), by: {k8s.cluster.name, k8s.workload.name, k8s.workload.kind} | sort k8s.cluster.name, container_count desc | limit 100 ``` ### Containers on Specific Nodes Find containers running on particular Kubernetes nodes: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.node.name) | fieldsAdd k8s.node.name, k8s.pod.name, name | summarize container_count = count(), by: {k8s.node.name} | sort container_count desc ``` **Use Case:** Identify node resource distribution and imbalances. ### Containers by Pod Group containers within pods: ```dql smartscapeNodes "CONTAINER" | filter isNotNull(k8s.pod.name) | fieldsAdd k8s.pod.name, k8s.namespace.name, name, k8s.container.name | summarize container_count = count(), by: {k8s.pod.name, k8s.namespace.name} | filter container_count > 1 | sort container_count desc ``` **Pattern:** Multi-container pods (sidecar pattern, init containers). ### Container Lifetime Analysis Analyze container age and churn: ```dql-snippet smartscapeNodes "CONTAINER" | fieldsAdd name, lifetime, k8s.workload.name | fieldsAdd age_hours = toDuration(timeframe(lifetime[start], to: now())), is_active = isNull(lifetime[end]) | summarize total_containers = count(), active_containers = countIf(is_active), avg_age_hours = avg(age_hours), by: {k8s.workload.name} | fieldsAdd avg_age_hours = round(avg_age_hours, decimals: 1) | sort total_containers desc | limit 20 ``` ### Short-Lived Containers Identify ephemeral containers that terminated quickly: ```dql smartscapeNodes "CONTAINER" | fieldsAdd name, lifetime, k8s.pod.name | filter isNotNull(lifetime[end]) | fieldsAdd lifespan_minutes = toDuration(timeframe(from: lifetime[start], to: lifetime[end])) | filter lifespan_minutes < 10m | sort lifespan_minutes asc | limit 50 ``` **Alert:** Very short-lived containers may indicate crash loops or failed init containers. ### Container Density per Cluster Calcu