Generate Metrics¶
This involves generating new metric data from existing data within the current workspace, thereby designing and implementing new technical metrics according to actual business needs.
Note
- Only roles with "Generate Metric Configuration Management Permissions" can create and edit metrics;
- After metrics are generated, they will be stored according to the current default data storage strategy, and charges will apply based on the number of generated time series;
- If no data is reported after generating the metric, it cannot be queried or analyzed in the workspace.
Use Cases¶
LOG, APM, RUM, Metrics, Security Check.
Create¶
- Select data source;
- Configure data query conditions;
- Define generated metric content, setting up the method and results for generating metrics, including the period for generating metrics, the label name of newly generated metrics, and the measurement set name.
Data Query¶
Metric data additionally supports PromQL queries. Beyond that, both simple queries and DQL queries are supported.
For more details, refer to Chart Query.
Data Source¶
Source | Description |
---|---|
LOG | That is, all index data already present in the current workspace. Based on these index data, you can choose all or individual log data sources within the current space to generate a new data collection. By adding filtering conditions and aggregation expressions to existing data, request the generation of new metric results and data collections. Here, * indicates selecting all data sources. |
APM | The source of service data that has already been enabled for collection. Here, * indicates selecting all data sources. |
RUM | The application data source in the current workspace, i.e., the names of applications that have already been enabled for collection. Here, * indicates selecting all data sources. |
Metrics | All metric data in the current workspace. |
Security Check | All/specific category data sources already present in the current workspace. After enabling the security check collector, categories include network , storage , database , system , webserver , Kubernetes . Here, * indicates selecting all data sources. |
Aggregation Functions¶
Function | Description |
---|---|
count |
Count statistics |
avg |
Average value statistics, requires selecting an aggregation field |
max |
Maximum value statistics, requires selecting an aggregation field |
min |
Minimum value statistics, requires selecting an aggregation field |
P75 |
Statistics for the 75th percentile of the specified field, requires selecting an aggregation field |
P95 |
Statistics for the 95th percentile of the specified field, requires selecting an aggregation field |
P99 |
Statistics for the 99th percentile of the specified field, requires selecting an aggregation field |
Dimensions¶
Aggregate data according to selected objects, i.e., generate a statistical value for each selected object in the data request.
Generated Metric Content¶
-
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 covering a time range of 1 minute.
- 1 minute (default), which means generating new metric data every 1 minute;
- 5 minutes
- 15 minutes
-
Measurement: Set the name of the metric set where the metric will be stored.
-
Metrics: Set the name of the metric, where metric names must not repeat, and multiple metrics can be added.
-
Tags: Automatically generated based on dimensions selected in the query.
-
Units: Optional, set the unit of the metric. After setting the unit for the generated metric, it can be applied in chart queries.
-
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 form, click Confirm to complete the generation of the metric rule and start data collection.
Note
If there is a delay in data exceeding 1 minute, then the data will not be counted after being written into the database.
Manage Rules¶
-
Edit: View all created metric generation rules and edit the metric generation rules.
-
Enable/Disable: Modify the status of the rule. After disabling the metric generation rule, the corresponding data will not be written into the metric set, and writing will resume after re-enabling.
-
Delete: Delete unnecessary rules. After deleting the rule, the metric set 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 generated metric data.
-
View Metrics
-
View in Metric Analysis: Navigate to the Metric Analysis page for querying and analyzing.
-
View in Metric Management: Navigate to the Metric Management page to view metrics and tags, where you can edit the units and descriptions of the metrics.
-
Note
- Since the data source, aggregation expression, etc., of the metric generation rule determine the data type, some configurations do not support editing or modification;
- Generated metrics are based on the data aggregated within the selected frequency and query time range. If no data is reported during this time period, the metric cannot be generated, nor can it be queried or searched in the metrics.
Use Cases¶
Chart Query¶
Perform metric data queries and analysis in Visual Charts.
Query Tool¶
Perform metric data queries and analysis in Shortcut > Query Tool > DQL Query.