Homeโ€บ๐Ÿ“ก SNMP Extensionsโ€บModule 51 min read ยท 6/16

Topology: Entities & Relationships

Hands-on2 exercises

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

FieldPurposeExample
nameEntity type ID (prefix:type)my_ext:device
idPatternGlobally unique entity IDmy_ext_device_{device.address}
instanceNamePatternDisplay name in UI{sys.name} ({device.address})
conditionLinks metrics to this entity type$prefix(com.dynatrace.extension.my-ext)
requiredDimensionsDimensions that must existdevice.address
roledefault = parent entityOnly 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.

๐Ÿ›  Try it

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.

extension.yamlYAML
Loading...

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 TypeRoleID Pattern Includes
ext:devicedefault (parent)device.address
ext:interfacechilddevice.address + if.name
ext:power_supplychilddevice.address + psu.idx
ext:sensorchilddevice.address + sensor.idx
๐Ÿ›  Try itExercise 2

Add a CHILD_OF relationship from topo_lab:interface to topo_lab:device.

extension.yamlYAML
Loading...

What's Next

Module 6 โ€” Screens & Dashboards. Build the UI pages that display your entity data.