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 requirements.

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

Applicable Scopes

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

Create

  1. Select the data source.
  2. Configure the data query conditions.
  3. Define the generated metric content, including the method and result settings for generating metrics, such as the generation cycle, tag names for the new metrics, and the measurement name.

Data Query

Metric data additionally supports PromQL queries. Apart from this, other data types support both simple queries and DQL queries.

For more details, refer to Chart Query.

Aggregation Functions

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

Dimensions

Aggregate data based on the selected objects, meaning a statistical value is generated for each selected object in the data request.

Generate Metric Content

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

    • 1 minute (default, i.e., generate new metric data every 1 minute)
    • 5 minutes (selected by default 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. 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 for the metric. Once set for a generated metric, it can be applied in chart queries.

  6. Description: Optional. Set a description for the metric. Once set for a generated metric, it can be applied in chart queries.

After completing the form, click Confirm to finalize the generate metric rule and start data collection.

Note

If data has a delay of more than 1 minute, it will not be counted once it lands in the database.

Manage List

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

  • Enable/Disable: Modify the rule's status. When a metric generation rule is disabled, the corresponding data will not be written to the measurement. Data writing resumes once the rule is enabled.

  • Delete: Remove unwanted rules. When a rule is deleted, the measurement is not deleted, but data writing stops.

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

  • Import: Import generate metric data.

  • View Metric

    • View in Metric Explorer: Jump to the Metric Explorer page for querying and analysis.

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

Note
  • Due to the data source and aggregation expressions of the generate metric rule determining the data type, some configurations do not support editing and modification.
  • Generated metrics are aggregated based on the frequency you selected and the data within the query time range. If no data is reported during that time period, metrics cannot be generated, nor can they be queried or searched within 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.

Feedback

Is this page helpful? ×