Skip to content

Generate Metrics


Generate new metric data from existing data within the current workspace, enabling the design and implementation of new technical metrics based on actual business needs.

Note
  • Only roles with "Generate Metrics Configuration Management Permissions" can create and edit metrics;
  • After metrics are generated, they will be stored according to the current default data storage policy and charged based on the number of generated time series;
  • If no data is reported after generating metrics, they cannot be queried or analyzed in the workspace.

Use Cases

Logs, APM, RUM, Metrics, Security Check, Synthetic Tests.

Create

  1. Select data sources;
  2. Configure data query conditions;
  3. Define generate metrics content, setting the method and results of generating metrics, including the frequency of generating metrics, the tag names of the newly generated metrics, and the measurement names.

Data Query

Metric data additionally supports PromQL queries. Apart from that, both simple queries and DQL queries are supported.

For more details, refer to Chart Query.

Data Sources

Source Description
Logs All indexed data in the current workspace. Based on these indexed data, you can select all or individual log data sources in the current space to generate new data sets. By adding filter conditions and aggregation expressions to the existing data, request to generate new metric results and data sets. Here, * represents selecting all data sources.
APM Service data sources that have enabled collection. Here, * represents selecting all data sources.
RUM Application data sources in the current workspace, i.e., the application names that have enabled collection. Here, * represents selecting all data sources.
Metrics All metric data in the current workspace.
Security Check All/individual categories of data sources in the current workspace. After enabling the Security Check collector, categories include network, storage, database, system, webserver, Kubernetes. Here, * represents selecting all data sources.

Aggregation Functions

Function Description
count Count the number
avg Calculate the average, requires selecting the aggregated field
max Calculate the maximum value, requires selecting the aggregated field
min Calculate the minimum value, requires selecting the aggregated field
P75 Calculate the 75th percentile of the specified field, requires selecting the aggregated field
P95 Calculate the 95th percentile of the specified field, requires selecting the aggregated field
P99 Calculate the 99th percentile of the specified field, requires selecting the aggregated field

Dimensions

Aggregate data according to the selected objects, i.e., generate a statistical value for each selected object in the data request.

Generate Metrics Content

  1. Frequency: The execution cycle for generating metrics. The selected time also serves as the aggregation time. Selecting a frequency of 1 minute means aggregating and generating metrics every 1 minute, with each aggregation time range also being 1 minute.

    • 1 minute (default), i.e., generate new metric data every 1 minute
    • 5 minutes
    • 15 minutes
  2. Measurement: Set the name of the measurement where the metrics will be stored.

  3. Metric: Set the name of the metric. Metric names can be duplicated, and multiple metrics can be added.

  4. Tags: Automatically generated based on the dimensions selected in the query.

  5. Unit: Optional, set the unit of the metric. After setting the unit for the generated metric, it can be applied in chart queries.

  6. Description: Optional, set the description of the metric. After setting the description for the generated metric, it can be applied in chart queries.

After completing the fields, click Confirm to finish generating the metric rule and start data collection.

Note

If data is delayed by more than 1 minute, it will not be counted after being stored.

Manage List

  • Edit: View all created generate metric rules and edit them.

  • Enable/Disable: Modify the status of the rule. When a metric generation rule is disabled, the corresponding data will not be written to the measurement. It will resume writing after being enabled.

  • Delete: Delete unnecessary rules. After a rule is deleted, the measurement will not be deleted, but data writing will stop.

  • Batch operations: Perform batch operations on specific rules, including enabling, disabling, deleting, and exporting rules.

  • Import: Import generate metric data.

  • View Metrics

    • View in Metric Analysis: Jump to the Metric Analysis page for querying and analyzing.

    • View in Metric Management: Jump to the Metric Management page to view metrics and tags. You can edit the metric unit and description.

Note
  • Since the data sources and aggregation expressions of the generate metric rules determine the data type, some configurations do not support editing and modification;
  • Generated metrics are aggregated based on the frequency and query time range you selected. If no data is reported within that time range, metrics cannot be generated, nor can they be queried or searched in the metrics.

Use Cases

Chart Query

Query and analyze metric data in Visual Charts.

Query Tool

Query and analyze metric data in Shortcut > Query Tool > DQL Query.