Skip to content

Generate Metrics


Generate new metrics data from existing data within the current workspace, thereby designing and implementing new technical metrics based on actual business requirements.

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, it cannot be queried or analyzed in the workspace.

Use Cases

LOG, APM, RUM, Metrics, Synthetic Tests, Basic Objects, Resource Catalog.

Create

  1. Select data source.
  2. Configure data query conditions.
  3. Define generate metrics content, including the method and results of generating metrics, such as the cycle of generating metrics, the tag name and measurement name of the newly generated metrics.

Data Query

Metrics data additionally supports PromQL queries. Other data types support simple queries and DQL queries.

For more details, refer to Chart Query.

Aggregation Functions

Function Description
count Count the number of items.
avg Calculate the average value. Requires selecting the aggregation field.
max Calculate the maximum value. Requires selecting the aggregation field.
min Calculate the minimum value. Requires selecting the aggregation field.
P75 Calculate the 75th percentile of the specified field. Requires selecting the aggregation field.
P95 Calculate the 95th percentile of the specified field. Requires selecting the aggregation field.
P99 Calculate the 99th percentile of the specified field. Requires selecting the aggregation field.

Dimensions

Aggregate data based on 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 of 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 metrics data every 1 minute)
    • 5 minutes (default selected when the data type is "Basic Objects" or "Resource Catalog")
    • 15 minutes
  2. Measurement: Set the name of the measurement where the metrics will be stored.

  3. Metrics: Set the name of the metrics. 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 metrics. After setting the unit for the generated metrics, it can be applied in chart queries.

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

After completing the above, click Confirm to finish generating the metrics 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 metrics rules and edit the generate metrics rules.

  • Enable/Disable: Modify the status of the rule. When a metrics 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 metrics data.

  • View Metrics

    • View in metrics analysis: Jump to the Metrics Analysis page for query and analysis.

    • View in metrics management: Jump to the Metrics Management page to view metrics and tags. You can edit the unit and description of the metrics.

Note
  • Since the data source, aggregation expression, etc., of the generate metrics rule determine the data type, some configurations do not support editing and modification.
  • The generated metrics are based on the data aggregation within the selected frequency and query time range. If no data is reported during this period, metrics cannot be generated, nor can they be queried or searched in the metrics.

Use Cases

Chart Query

Query and analyze metrics data in Visual Charts.

Query Tool

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