Expert Mode: Model Generation Setup
Table of Contents
- General Description
- 1. Data Context Configuration
- 2. Model Services Configuration
- 3. Model Metrics Configuration
- 4. Removing Circular Dependencies
- 5. Model Run Schedule
General Description
The expert mode for model generation setup provides detailed configuration of all aspects of the model with flexible customization capabilities. It is suitable for experienced users who need full control over data structure, filtering, service templates, and metrics.
1. Data Context Configuration
Purpose of this step - to build a hierarchy (tree) of data sources (assets) that determines where, in what order, and with what filters the data is loaded for the model.
Description
Data context is a sequence of nodes arranged in a tree. Each node describes one data source. The system traverses this tree from top to bottom and sequentially loads data, substituting filters from parent steps into child steps.
Node Structure
Each node is a settings block that contains:
| Parameter | What it defines | Example |
|---|---|---|
| Node Name | Unique name of the node in the tree | resources |
| Parent Node | Which node the current one depends on (can be empty for root) | all_services |
| Active's config | Data source | [pg] APM: Services |
| Fields for view | Which fields to load from the asset | service, resource |
| Filters | Data selection conditions. Can reference parent step fields via {{ ... }} or be explicit values | {{ all_services.source_services }}, host_office |
| Hide node | If checked - node participates in calculations but is not displayed in the final visualization. Node is automatically hidden if data obtained at its stage exceeds 30 records | - |
The system supports any number of independent trees. Each tree is processed separately, and results are combined into the final context.
Filter Operation Principle
Filters allow loading only the data that relates to the parent step.
Example: need to load services only for a specific host.
- Node
Hostsloads all hosts (fields:id,name) - Node
Serviceshas filter:host_id = {{ hosts.id }} - The system substitutes each host's
idinto the filter and loads only its services
Reference syntax: {{ node_name.field }}.
Step-by-Step Instructions
To create a new node:
- Click the
+ Add Nodebutton - Enter
Node Name- unique name - Select
Parent Nodefrom the dropdown list (or leave empty for root) - Select
Active's config- where to get data from - Check
Fields for view- which fields are needed - If necessary, add
Filtersand specify conditions - If necessary, check
Hide node
To edit an existing node:
- Click on the node block
- Change the required parameters
- Changes are saved automatically
To delete a node:
- Click on the trash icon in the node block
- Confirm deletion
| Rule | Description |
|---|---|
| Node name must be unique | Cannot create two nodes with the same name |
| Parent node must exist | Parent must already be created when specified |
| Cannot create cycles | A node cannot be a parent to itself or its descendant |
| Filters reference only parent nodes | Cannot reference a node from another branch or child |
| Hidden nodes are not visible in visualization | But participate in calculations and pass data to descendants |
2. Model Services Configuration
Purpose of this step - to define the template of how services will look in the final model: which fields to take for identifier, how to form the name, and how services are related to each other.
Configuration Parameters
Basic service parameters:
| Parameter | What it defines | Example |
|---|---|---|
| Node | Name of the node created in the first step | all_services |
| Identifier | Template by which the unique service ID is built | {{ all_services.service }} |
| Service Name | Template of the name that will be displayed on the model | {{ all_services.title }} |
| Description | Additional explanation for the service (optional) | - |
Setting up connection with another service (if the current service depends on another):
| Parameter | What it defines | Example |
|---|---|---|
| Node | Name of the node where the dependent service is located | resources |
| Target Service Identifier | Template of the ID of the service on which the current one depends | {{ resources.service }} |
Configuration Example
Suppose the following nodes were created in the first step:
all_services- list of all servicesresources- list of resources that services depend on
Process of configuring a service with a connection:
- Select node
all_services - Specify identifier:
{{ all_services.service }} - Specify name:
{{ all_services.service }} - In the
Connectionblock, specify noderesources - Specify target service identifier:
{{ resources.service }}
Result in the model: a service with a name and an arrow to the resource it depends on will appear.
Step-by-Step Instructions
To configure basic service parameters:
- Select
Nodefrom the dropdown list (nodes created in Step 1 are available) - Enter a template using
{{ ... }}in theIdentifierfield - Enter a template for display in the
Service Namefield - Fill in
Descriptionif necessary
To configure connection with another service:
- Expand the
Connectionblock - Select
Nodewhere the dependent service is located - Enter a template in the
Target Service Identifierfield - Add multiple connections if necessary (if supported)
To delete a service or connection:
- click on the trash icon next to the corresponding block
3. Model Metrics Configuration
Purpose of this step - to define the metrics template: what indicators will be collected for services, where to get them from, and how to aggregate them.
The template is applied to all services automatically. For each service, the system will substitute its own values (via {{ ... }}) and generate metrics according to the specified rules.
Description
Metrics are indicators that characterize the state of a service (for example, CPU load, number of requests, response time).
In this step, you bind global metrics (from the Service Monitor Toolkit monitoring system) to your services and configure exactly how they will be calculated.
Service Structure
At the top, the Service Structure block is displayed - this is a list of previously configured services for which metrics will be collected. Service structures are formed in Step 2.
Configuration Parameters
| Parameter | What it defines | Example |
|---|---|---|
| Global Metric | Global metric available for binding | cpu_usage, request_duration |
| Metric Service Name | Template of the metric name for a specific service | {{ service.name }}_cpu |
| Description | Explanation of what the metric shows and how it is calculated | "CPU load in percent" |
| Filter group | Filtering of global metric objects for binding to the required service | namespace = {{ service.namespace }} |
| Common State Detection Function | Method of combining indicators into one service metric | avg, min, max |
Step-by-Step Instructions
To create a new metric:
- Click
+ Add Metric Structure - Select
Service Monitor Toolkit Metricfrom the dropdown list - Enter a template using
{{ ... }}in theService Metric Namefield - Fill in
Description(recommended) - Add filtering conditions in the
Filter Groupsblock - Select
Aggregation Function(avg,minormax) - Click
Save
To edit a metric:
- Click on the metric block
- Change the required parameters
- Changes are saved automatically
To delete a metric:
- click on the trash icon in the metric block
Filter Operation Principle
A global metric can contain data for multiple objects. Filters allow selecting only the data that relates to a specific service.
Example: global metric cpu_usage has tags: service_name, pod, namespace.
To bind it to service payment:
| Parameter | Value |
|---|---|
| Service Monitor Toolkit Metric | cpu_usage |
| Filter Groups | service_name = "payment" |
| Metric Service Name | {{ service.name }}_cpu_usage |
Reference syntax: {{ node_name.field }}.
Aggregation Functions
When multiple metric values are found by filters (for example, multiple pods of a service), they need to be combined into one service metric.
| Function | What it does | Example usage |
|---|---|---|
| avg | Arithmetic mean | Average CPU load across all pods |
| min | Minimum value | Lowest load (to identify idle pods) |
| max | Maximum value | Peak load (to identify overloaded pods) |
4. Removing Circular Dependencies
Purpose of this step - to eliminate circular connections that may arise due to complex data structure and lead to incorrect model operation.
Step-by-Step Instructions
Automatic removal:
- Click the
Remove all cycles (n)button, wherenis the number of found cycles - The system will automatically find and delete all circular dependencies
Manual removal:
- Find the problematic connection in the interface (usually highlighted)
- Click on the trash icon next to the dependency
5. Model Run Schedule
Purpose of this step - to configure the schedule according to which the model will be automatically recalculated.
Schedule Types
| Type | Description | Example |
|---|---|---|
| Cron Expression | Flexible configuration through standard cron-syntax | */5 * * * * - every 5 minutes |
| Interval | Simple selection: start time/interval/units | 01/01/2026 / 20 / days |