Generate Metrics¶
TrueWatch supports generating new metric data based on existing data in the current workspace, so that you can design and implement new technical metrics according to your needs.
Warning
- Only roles with the Generate Metrics Configuration Management permission list can create and edit generated metrics;
- After metrics are generated, metric data is stored according to the current default data storage policy, and you are billed based on the number of time series generated;
- After metrics are generated, if no data is reported during that period, they cannot be queried or analyzed in the workspace. For example, you cannot query metric data in Metrics Analysis, Charts, or the DQL Query Tool.
Create/Clone Rule¶
Go to the Application Performance Monitoring (APM) > Generate Metrics page.
- Click Create to start creating a new generated metrics rule.
- Click the icon to clone an existing rule and create a new rule.
Step 1: Data source. Filter all/single service data sources that already exist in the current workspace, and use this data source to start generating new data.
- Source: The data source, that is, the service data source for which collection has been enabled; Note: "*" indicates all data sources
Step 2: Data query. Based on the selected data source, you can add filter and aggregation expressions to existing data to request new metric results and data sets.
- Aggregation method: see the table below
| Aggregation Method | Description |
|---|---|
| count | Count the number |
| avg | Calculate the average value; the field to aggregate must be selected |
| max | Calculate the maximum value; the field to aggregate must be selected |
| min | Calculate the minimum value; the field to aggregate must be selected |
| P75 | Calculate the 75th percentile value of the specified field; the field to aggregate must be selected |
| P95 | Calculate the 95th percentile value of the specified field; the field to aggregate must be selected |
| P99 | Calculate the 99th percentile value of the specified field; the field to aggregate must be selected |
- Dimension: Aggregate data by the selected object, meaning a statistical value is generated for each selected object in the data request;
- Filter: Supports adding one or more filter conditions to existing tag data, and adding and/or relationships to conditions in the same row.
Step 3: Generate metrics. Configure the method and result of generating metrics, including the generation cycle, and the tag names and measurement names of the newly generated metrics.
| Field | Description |
|---|---|
| Frequency | The execution cycle for generating metrics. The default is 1 minute, meaning new metric data is generated every 1 minute. The time selected for Frequency is also used as the aggregation time. If Frequency is 1 minute, metrics are aggregated and generated every 1 minute, and the aggregation time range for each run is also 1 minute. |
| Measurement | Set the name of the measurement where metrics are stored. |
| Metric | Set the metric name. Metric names must be unique, and multiple metrics can be added. |
| Tag | Automatically generated based on the dimensions selected in the query. |
| Unit | Optional. Set the unit of the metric. After a unit is set for a generated metric, it can be applied in chart queries. |
| Description | Optional. Set the metric description. After a description is set for a generated metric, it can be applied in chart queries. |
Step 4: After completing the generation rule, click OK to complete the generated metrics rule and start data collection.
Operations¶
All added rules are displayed on the Generate Metrics page. You can perform the following operations:
Note:
-
Because the data source, aggregation expression, and other settings of a generated metrics rule determine the data type, some rules do not support editing or modification.
-
After a metric generation rule is disabled, the corresponding data will not be written to the measurement. Writing resumes after the rule is enabled.
-
After a rule is deleted, the measurement is not deleted, but data writing stops.
View Metrics¶
View in Metrics Analysis¶
On the Generate Metrics page, click the Open in Metrics Analysis button to the right of a rule to go to the Metrics Analysis page for queries and analysis.
Note: Generated metrics are generated by aggregating data within the query time range based on the frequency you select. If no data is reported during the period, metrics cannot be generated and cannot be queried or searched in Metrics.
View in Metrics Management¶
On the Generate Metrics page, click the Open in Metrics Management button to the right of a rule to go to the Metrics Management page to view metrics and tags. You can edit metric units and descriptions.
Use Cases¶
Chart Query¶
After metrics are generated, go to Scenes > Dashboards > Create Dashboard and query and analyze metric data in visual charts.
DQL Query Tool¶
After metrics are generated, you can use DQL to query and analyze metric data in the Query Workbench.





