Unified analysis tutorial
This is a step-by-step tutorial on how to upload the custom topology to your Dynatrace environment and build an extension to define the topology types and relationships between them.
You can then define your unified analysis screens to analyze data from multiple sources, including logs, metrics, and traces in a unified view. You can also include various data sources and dimensions, apply filters, and drill down into specific details.
Prerequisites
- Dynatrace CLI
Python 3.8 or 3.9
Access to pip package installer for Python
- Install dt-cli
For more information, see Sign extensions.1pip install dt-cli
- Token with the following permissions:
- Read credential vault entries (
credentialVault.read
) - Write credential vault entries (
credentialVault.write
) - Read entities (
entities.read
) - Write entities (
entities.write
) - Ingest events (
events.ingest
) - Ingest metrics (
metrics.ingest
) - Ingest logs (
logs.ingest
) - Read extensions (
extensions.read
) - Write extensions (
extensions.write
)
- Read credential vault entries (
Upload sample observability data to your environment
In this example, we use Easy Taxis Fleet Simulator—an interactive CLI app that simulates a fleet of smart taxis sending observability data to the Dynatrace environment.
-
Based on your operating system, download the appropriate file from the list of EasyTaxis executables and run it.
-
Type
help
to list all available commands. -
Use the command below to start up the fleet simulation.
1start -e <your-environment-url> -t <your-api-token>Be sure to replace
<your-environment-url>
and<your-api-token>
with the actual values.For more information about the arguments and flags, use
start help
command.
The simulation ingests metrics, logs, and events to your Dynatrace environment.
Build and upload the extension
-
Go to the GitHub page and download the Observability Clinic Materials.
-
Open the
extensions-project-starter
folder in your preferred code environment. -
Go to the
scripts
folder and open theconfig.yaml
file. You need to complete three mandatory fields with your environment URL, token, and schema version.1tenant_url: <your-environment-url>2api_token: <your-api-token>3schema_version: 1.265 -
From the
scripts
directory, execute the following command to generate certificates.1python initialize.pyThe generated certificates now can be found in the
certs
folder. -
Execute the following command to download the schemas for version 1.265.
1python download_schemas.py -
Go to the
extension
folder and create theextension.yaml
file. For more information about extension scope, see Extension YAML file. -
Use the following extension example of the defined topology. For more information about topology scope, see WMI tutorial - custom topology.
1name: custom:ua.example2version: 1.0.03minDynatraceVersion: "1.238"4author:5 name: Joe Doe67topology:8 types:9 - enabled: true10 name: easytaxis:smart_fleet11 displayName: Smart Fleet12 rules:13 - idPattern: fleet_{fleet.id}14 instanceNamePattern: Smart Fleet ({fleet.id})15 iconPattern: cluster16 sources:17 - sourceType: Metrics18 condition: $prefix(custom.easytaxis.fleet)19 attributes:20 - key: FleetID21 pattern: "{fleet.id}"22 - key: Location23 pattern: "{fleet.location}"24 role: default25 - idPattern: fleet_{fleet.id}26 instanceNamePattern: Smart Fleet ({fleet.id})27 iconPattern: cluster28 sources:29 - sourceType: Metrics30 condition: $prefix(custom.easytaxis.taxi)31 - sourceType: Logs32 role: default33 - enabled: true34 name: easytaxis:smart_taxi35 displayName: Smart Taxi36 rules:37 - idPattern: taxi_{fleet.id}_{taxi.id}38 instanceNamePattern: Smart Taxi ({taxi.id})39 sources:40 - sourceType: Metrics41 condition: $prefix(custom.easytaxis.taxi)42 attributes:43 - key: TaxiID44 pattern: "{taxi.id}"45 - key: RegistrationNumber46 pattern: "{taxi.registration}"47 - key: Class48 pattern: "{taxi.class}"49 role: default50 relationships:51 - enabled: true52 sources:53 - sourceType: Metrics54 condition: $prefix(custom.easytaxis)55 fromType: easytaxis:smart_taxi56 typeOfRelation: CHILD_OF57 toType: easytaxis:smart_fleet -
Execute the following command to sign the extension and upload it to the environment.
1python build_and_upload.py
Verify your progress
If you now go to Settings > Topology model > Generic types, you'll see that the Smart Fleet and Smart taxi types have been created. You can also see the defined relationship between them in the Generic relationships section.
-
For a list of Smart Fleet instances, go to
<your-environment>/ui/entity/list/easytaxis:smart_fleet
. -
For a list of Smart Taxi instances, go to
<your-environment>/ui/entity/list/easytaxis:smart_taxi
.
Configure unified analysis screens
You can now customize your entity screens by creating a screen definition in the extension.yaml
file.
1screens:2 - entityType: easytaxis:smart_fleet3 detailsSettings:4 staticContent:5 showProblems: true6 showProperties: true7 showTags: true8 showGlobalFilter: true9 showAddTag: true10 layout:11 autoGenerate: false12 cards:13 - type: ENTITIES_LIST14 key: fleet-list-taxis15 entitiesListCards:16 - key: fleet-list-taxis17 displayName: Taxis part of this fleet18 pageSize: 519 entitiesLimit: 50020 displayCharts: false21 enableDetailsExpandability: true22 numberOfVisibleCharts: 223 displayIcons: true24 entitySelectorTemplate: type(easytaxis:smart_taxi),fromRelationships.isChildOf($(entityConditions))25 columns:26 - type: ATTRIBUTE27 attribute:28 key: Class29 displayName: Class30 - type: ATTRIBUTE31 attribute:32 key: RegistrationNumber33 displayName: Registration34 charts:35 - displayName: Engine Temperature36 graphChartConfig:37 visualization:38 themeColor: DEFAULT39 seriesType: LINE40 metrics:41 - metricSelector: custom.easytaxis.taxi.engine.temperature42 visualizationType: GRAPH_CHART43 - displayName: Speed44 graphChartConfig:45 visualization:46 themeColor: DEFAULT47 seriesType: LINE48 metrics:49 - metricSelector: custom.easytaxis.taxi.speed50 visualizationType: GRAPH_CHART51 - entityType: easytaxis:smart_taxi52 propertiesCard:53 properties:54 - type: RELATION55 relation:56 entitySelectorTemplate: type(easytaxis:smart_fleet),toRelationships.isChildOf($(entityConditions))57 displayName: Mother Fleet58 detailsSettings:59 staticContent:60 showTags: true61 showProperties: true62 showProblems: true63 showAddTag: true64 showGlobalFilter: true65 layout:66 autoGenerate: false67 cards:68 - type: CHART_GROUP69 key: taxi-metrics70 chartsCards:71 - key: taxi-metrics72 displayName: Smart Taxi Metrics73 numberOfVisibleCharts: 374 charts:75 - displayName: Engine Temperature76 graphChartConfig:77 visualization:78 themeColor: DEFAULT79 seriesType: LINE80 metrics:81 - metricSelector: custom.easytaxis.taxi.engine.temperature82 visualizationType: GRAPH_CHART83 - displayName: Speed84 graphChartConfig:85 visualization:86 themeColor: DEFAULT87 seriesType: LINE88 metrics:89 - metricSelector: custom.easytaxis.taxi.speed90 visualizationType: GRAPH_CHART91 - displayName: Days to revision92 graphChartConfig:93 visualization:94 themeColor: DEFAULT95 seriesType: LINE96 metrics:97 - metricSelector: custom.easytaxis.taxi.engine.daystorevision98 visualizationType: GRAPH_CHART99 listSettings:100 staticContent:101 showGlobalFilter: true102 layout:103 autoGenerate: true
-
For the Smart Taxi entity, this definition includes three charts with data on speed, engine temperature and days to revision.
-
For the Smart Fleet entity, this definition includes the list of the taxis that are a part of this fleet. You can expand each taxi entity and see two graphs with speed and engine temperature data.