WMI tutorial - custom topology
Having a well-defined topology model helps make sense of all the metrics and data ingested in Dynatrace.
For an Extensions 2.0 extension, this all happens in the topology
section, which is split into two parts:
types
- defines which new entity types the extension monitorsrelationships
- defines if and how these entity types relate to each other
Key aspects when defining types
idPattern
- Must be unique enough to represent each device instance without duplicating itsources
- Must define rules for all metrics of the extension that should be split by this entitycondition
- Can make use of functions like$prefix(...)
to define patterns for metric keysattributes
- Are optional details that can be extracted from the dimensions of metrics
Key aspects when defining relationships
sources
- Any metric that matches the pattern will be evaluated for a relationship. This means it should belong to both entity types part of the relationship
Find your new entities in UI
Navigate to ../ui/entity/list/{entity-type}
on your Dynatrace environment. For example:
../ui/entity/list/wmi:generic_host
../ui/entity/list/wmi:generic_network_device
Tasks
- Add the
topology
section to yourextension.yaml
using the template below. - Define two entity types for a Generic Host and a Generic Network Device.
- Ensure that network devices are aware of the type (
Adapter
orInterface
). - Create a relationship between the two where a Generic Network Device runs on a Generic Host.
- Package and upload a new version of your extension.
- Validate the new entities are created.
For more information on extending the Dynatrace topology, see Custom topology model
topology:types:- name: wmi:generic_hostdisplayName: Generic Hostenabled: truerules:- idPattern: wmi_generic_host_{dt.entity.host}sources:- sourceType: Metricscondition: $prefix(custom.demo.host-observability)attributes: []requiredDimensions: []instanceNamePattern: Generic Host on {dt.entity.host}- name: wmi:generic_network_devicedisplayName: Network deviceenabled: truerules:- idPattern: wmi_generic_{dt.entity.host}_{network.type}_{network.name}sources:- sourceType: Metricscondition: $prefix(custom.demo.host-observability.network)attributes:- pattern: '{network.name}'key: wmi_network_namedisplayName: Name- pattern: '{network.type}'key: wmi_network_typedisplayName: TyperequiredDimensions: []instanceNamePattern: Network {network.type} {network.name} on {dt.entity.host}relationships:- typeOfRelation: RUNS_ONfromType: wmi:generic_network_devicetoType: wmi:generic_hostenabled: truesources:- sourceType: Metricscondition: $prefix(custom.demo.host-observability)
Results
You should see new entities created for your generic host and generic network device entity types:
Next step: Unified analysis page