Homeโ€บ๐Ÿ” Track 2: Query & Exploreโ€บModule 72 min read ยท 8/21

Entities, Topology & Traces

Tutorial

Entities, Topology & Traces

Dynatrace auto-discovers every entity (host, service, process) and maps their relationships in Smartscape. Distributed traces show how requests flow across services.

Entity Queries

// Hosts with details
fetch dt.entity.host
| fields entity.name, monitoringMode, state, tags

// Services
fetch dt.entity.service
| fields entity.name, serviceType

// Discover available fields
describe dt.entity.host

Entity Types

Entity Type                     What It Represents
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
dt.entity.host                  Servers, VMs, EC2 instances
dt.entity.service               Auto-detected services
dt.entity.process_group         Groups of identical processes
dt.entity.application           RUM web applications
dt.entity.http_check            HTTP synthetic monitors
dt.entity.browser_monitor       Browser clickpath monitors
dt.entity.kubernetes_cluster    K8s clusters

Smartscape: Topology Queries

Smartscape commands let you traverse relationships between entities:

// Load all hosts as topology nodes
smartscapeNodes HOST

// Find what processes run on a host
smartscapeNodes PROCESS
| traverse runs_on, HOST, direction: forward
| fields process_name = dt.traverse.history[0][name], host_name = name

โš ๏ธ Smartscape commands (smartscapeNodes, smartscapeEdges, traverse) are in Preview. The fetch dt.entity.* syntax is stable and fully supported. Use Smartscape when you need relationship traversal.

Distributed Traces (PurePath)

A distributed trace shows a request's journey across services. Dynatrace calls this a PurePath โ€” it captures every service call, database query, and external request.

// Recent traces with duration
fetch spans
| fields trace.id, span.name, duration, service.name
| sort duration desc
| limit 10

// Slow requests (> 5 seconds)
fetch spans
| filter span.kind == "SERVER"
| filter duration > 5000000000
| fields trace.id, service.name, duration
| sort duration desc

๐Ÿ’ก Use the Distributed Tracing app (Ctrl+K โ†’ "Distributed Tracing") for visual trace analysis with facets, filtering, and waterfall views. DQL is for programmatic access.

Relationships via expand

Entity relationships are stored as nested records. Use expand to flatten them:

fetch dt.entity.service
| expand belongs_to
| fields entity.name, belongs_to
| limit 10

๐Ÿ›  Try it: Open the Smartscape app โ†’ click any host โ†’ follow the connections to processes โ†’ services โ†’ applications. This is the topology graph that powers Davis root cause analysis. Try: smartscapeNodes HOST in a Notebook to see it as data.