Topology: Entities & Relationships
What is Topology?
Topology turns your metrics into entities โ things you can click on in Dynatrace. A device entity, interface entities, sensor entities โ each with their own page.
Without topology, you just have metrics floating in space. With topology, you get a device page showing "Switch-01" with its interfaces listed below.
Entity Types
Define entity types in the topology: section:
topology:
types:
- name: my_ext:device
displayName: My Device
enabled: true
rules:
- idPattern: my_ext_device_{device.address}
instanceNamePattern: "{sys.name} ({device.address})"
sources:
- sourceType: Metrics
condition: $prefix(com.dynatrace.extension.my-ext)
requiredDimensions:
- key: device.address
role: default
Key Fields Explained
| Field | Purpose | Example |
|---|---|---|
name | Entity type ID (prefix:type) | my_ext:device |
idPattern | Globally unique entity ID | my_ext_device_{device.address} |
instanceNamePattern | Display name in UI | {sys.name} ({device.address}) |
condition | Links metrics to this entity type | $prefix(com.dynatrace.extension.my-ext) |
requiredDimensions | Dimensions that must exist | device.address |
role | default = parent entity | Only on the top-level device |
idPattern must be globally unique โ always include device.address plus a child identifier. Two devices with the same idPattern merge into one entity.
Add a child entity type topo_lab:interface below the device type. Use {device.address}_{if.name} in the idPattern to make it unique. No role: needed for children.
Relationships
Connect child entities to parents with CHILD_OF:
relationships:
- fromType: my_ext:interface
toType: my_ext:device
typeOfRelation: CHILD_OF
enabled: true
sources:
- sourceType: Metrics
condition: $prefix(com.dynatrace.extension.my-ext)
This makes interfaces appear as children on the device detail page.
Entity Attributes
Show extra info on entity pages with attributes::
attributes:
- key: dt.ip_addresses # special: enables IP lookup
pattern: "{device.address}"
- key: devDescription
displayName: Description
pattern: "{sys.descr}"
๐ก Special attribute keys: dt.ip_addresses enables IP lookup, dt.listen_ports shows ports, dt.dns_names shows DNS names.
Common Entity Type Patterns
| Entity Type | Role | ID Pattern Includes |
|---|---|---|
ext:device | default (parent) | device.address |
ext:interface | child | device.address + if.name |
ext:power_supply | child | device.address + psu.idx |
ext:sensor | child | device.address + sensor.idx |
Add a CHILD_OF relationship from topo_lab:interface to topo_lab:device.
What's Next
Module 6 โ Screens & Dashboards. Build the UI pages that display your entity data.