We continue with our Easy Shipping LTD logistics example, in which trucks and truck-mounted containers send telemetry data to Dynatrace.
The example data stream conforms to the Dynatrace metric line protocol format.
truck.fuel.total,trucknr=99,model=mac-granite 10234truck.fuel.usage,trucknr=99,model=mac-granite 17truck.operation.hours,trucknr=99,model=mac-granite 23766truck.fuel.total,trucknr=12,model=mac-anthem 234truck.fuel.usage,trucknr=12,model=mac-anthem 10truck.operation.hours,trucknr=12,model=mac-anthem 13766container.temperature,containernr=234321,trucknr=99 40container.temperature.dev,containernr=234321,trucknr=99 0container.temperature,containernr=111111,trucknr=12 39container.temperature.dev,containernr=111111,trucknr=12 2.5
To define a new entity type, provide the entity name and specify its extraction rules.
Based on the example above, define a new entity type Truck within a Dynatrace environment.
truck
entity type.To make sure it's unique for your whole Dynatrace environment, prefix Type name with your topology-specific domain (for example, logistics:truck
).
Teach Dynatrace how your new entity type should be automatically matched and how to identify unique entity instances (trucks).
Select Add extraction rule.
To specify the extraction rule for the instance identifier for your new entity type, set Extracted ID pattern to {trucknr}
.
You must use a {placeholder}
referring to the dimension name to make sure the instance identifier is unique. The dimension value will become the instance identifier.
To specify the extraction rule for the instance name for your new entity type, set Instance name pattern to {trucknr}
.
The dimension value will become the instance name.
To specify the extraction rule for the entity attribute, select Add attribute extraction rule. In this example, each truck's data is reported with the model
dimension, which is the truck attribute:
{model}
dimension. The dimension value will become the attribute name.Repeat the above steps to define additional entities. In this case, we still need to define the container
entity type, specify its extraction rules (containernr
), and specify extraction rules for its attributes (trucknr
).
After you configure your own domain types on top of your incoming metrics or log streams, Dynatrace will automatically extract and create new instances of trucks and containers whenever a truck or container starts sending its telemetry data.
To complete the topology definition, define a relationship between the truck and the carried container. Without this relationship, the truck- and container-related measurements will be reported separately by Dynatrace with no topological relationship.
To extract a relationship between a given entity type and another entity type, we need to find a joined data stream. In our example, it's the container temperature measurement that contains both identifying values, the truck number and the container number. For example:
container.temperature,containernr=111111,trucknr=12 39
With a joined data stream, we now can define a relationship between a truck and a container.
Metrics
$eq(container.temperature)
$eq(container.temperature)
is used to match the container.temperature
metric.logistics:container
logistics:truck
is child of
logistics:container
) and Destination type (logistics:truck
), meaning, in this case, that logistics:container
is child of
logistics:truck
.The use of roles (such as client and server, or caller and callee) is optional. In our example, we don`t need to specify those roles as the joining data source contains two different entity types.
Roles are necessary if you want to connect two instances of the same entity type by a joining measurement.
An example here would be a measurement line that shows the response time of a service calling another service. For example:
service.responsetime,caller=service1,callee=service2 39
With the above example, two service instances of the same service type should be extracted and combined with a call relationship.
In this case, one extraction rule has to be identified with a role (caller) and the other extraction with a different role (callee).
During the extraction of the relationship, the caller and callee role can then be used to specify the direction of the resulting relationship.