Skip to content

Commit 456785b

Browse files
committed
feat: querier add table in_process_metrics
1 parent 75d22af commit 456785b

File tree

18 files changed

+216
-48
lines changed

18 files changed

+216
-48
lines changed

server/controller/db/metadb/migrator/schema/const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ const (
2020
RAW_SQL_ROOT_DIR = "/etc/metadb/schema/rawsql"
2121

2222
DB_VERSION_TABLE = "db_version"
23-
DB_VERSION_EXPECTED = "7.1.0.2"
23+
DB_VERSION_EXPECTED = "7.1.0.3"
2424
)

server/controller/db/metadb/migrator/schema/rawsql/mysql/init.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,9 @@ INSERT INTO data_source (id, display_name, data_table_collection, base_data_sour
22192219
set @lcuuid = (select uuid());
22202220
INSERT INTO data_source (id, display_name, data_table_collection, base_data_source_id, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
22212221
VALUES (24, '应用-指标(天级)', 'flow_metrics.application*', 23, 86400, 30*24, 'Sum', 'Avg', @lcuuid);
2222+
set @lcuuid = (select uuid());
2223+
INSERT INTO data_source (id, display_name, data_table_collection, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
2224+
VALUES (25, '应用-性能剖析指标', 'profile.in_process_metrics', 1, 3*24, 'Sum', 'Avg', @lcuuid);
22222225

22232226
CREATE TABLE IF NOT EXISTS voucher (
22242227
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,

server/controller/db/metadb/migrator/schema/rawsql/mysql/issu/7.1.0.2.sql

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
DROP PROCEDURE IF EXISTS insert_data_source;
2+
3+
CREATE PROCEDURE insert_data_source()
4+
BEGIN
5+
DECLARE existing_display_name INT DEFAULT 0;
6+
7+
SELECT COUNT(*) INTO existing_display_name
8+
FROM data_source
9+
WHERE id = 25;
10+
11+
IF existing_display_name = 0 THEN
12+
START TRANSACTION;
13+
set @lcuuid = (select uuid());
14+
INSERT INTO data_source (id, display_name, data_table_collection, `interval_time`, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
15+
VALUES (25, '应用-性能剖析指标', 'profile.in_process_metrics', 1, 3*24, 'Sum', 'Avg', @lcuuid);
16+
COMMIT;
17+
END IF;
18+
19+
END;
20+
21+
CALL insert_data_source();
22+
DROP PROCEDURE insert_data_source;
23+
24+
UPDATE db_version SET version='7.1.0.3';

server/controller/db/metadb/migrator/schema/rawsql/postgres/init.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,9 @@ VALUES (23, '应用-指标(小时级)', 'flow_metrics.application*', 8, 3600
16181618
INSERT INTO data_source (id, display_name, data_table_collection, base_data_source_id, interval_time, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
16191619
VALUES (24, '应用-指标(天级)', 'flow_metrics.application*', 23, 86400, 30 * 24, 'Sum', 'Avg', gen_random_uuid());
16201620

1621+
INSERT INTO data_source (id, display_name, data_table_collection, interval_time, retention_time, summable_metrics_operator, unsummable_metrics_operator, lcuuid)
1622+
VALUES (25, '应用-性能剖析指标', 'profile.in_process_metrics', 1, 3 * 24, 'Sum', 'Avg', gen_random_uuid());
1623+
16211624
CREATE TABLE IF NOT EXISTS report (
16221625
id SERIAL PRIMARY KEY,
16231626
title VARCHAR(200) NOT NULL DEFAULT '',

server/controller/http/service/data_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ var DEFAULT_DATA_SOURCE_DISPLAY_NAMES = []string{
9898
"事件-IO 事件", // event.perf_event
9999
"事件-告警事件", // event.alert_event
100100
"应用-性能剖析", // profile.in_process
101+
"应用-性能剖析指标", // profile.in_process_metrics
101102
"网络-网络策略", // flow_metrics.traffic_policy
102103
"日志-日志数据", // application_log.log
103104
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Field , DBField , Type , Category , Permission
2+
profile_value , profile_value , counter , APP Profile , 111
3+
row , , other , Other , 111
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Field , DisplayName , Unit , Description
2+
profile_value , profile_value , ,
3+
row , 行数 , 个 ,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Field , DisplayName , Unit , Description
2+
profile_value , profile_value , ,
3+
row , Row Count , ,

server/querier/db_descriptions/clickhouse/tag/event/alert_event

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ pod_ns , pod_ns_0 , pod_ns_1
2222
pod_node , pod_node_0 , pod_node_1 , resource , , Universal Tag , 111 , 0 , 110
2323
pod_ingress , pod_ingress_0 , pod_ingress_1 , resource , , Universal Tag , 111 , 0 , 110
2424
pod_service , pod_service_0 , pod_service_1 , resource , , Universal Tag , 111 , 0 , 110
25-
pod_group_type , pod_group_type_0 , pod_group_type_1 , int_enum , pod_group_type , Universal Tag , 111 , 0 , 110
25+
pod_group_type , pod_group_type_0 , pod_group_type_1 , int , , Universal Tag , 111 , 0 , 110
2626
pod_group , pod_group_0 , pod_group_1 , resource , , Universal Tag , 111 , 0 , 110
2727
pod , pod_0 , pod_1 , resource , , Universal Tag , 111 , 0 , 110
2828
service , service_0 , service_1 , resource , , Universal Tag , 111 , 1 , 110
29-
auto_instance_type , auto_instance_type_0 , auto_instance_type_1 , int_enum , auto_instance_type , Universal Tag , 111 , 0 , 110
29+
auto_instance_type , auto_instance_type_0 , auto_instance_type_1 , int , , Universal Tag , 111 , 0 , 110
3030
auto_instance , auto_instance_0 , auto_instance_1 , resource , , Universal Tag , 111 , 0 , 110
31-
auto_service_type , auto_service_type_0 , auto_service_type_1 , int_enum , auto_service_type , Universal Tag , 111 , 0 , 110
31+
auto_service_type , auto_service_type_0 , auto_service_type_1 , int , , Universal Tag , 111 , 0 , 110
3232
auto_service , auto_service_0 , auto_service_1 , resource , , Universal Tag , 111 , 0 , 110
3333
gprocess , gprocess_0 , gprocess_1 , resource , , Universal Tag , 111 , 0 , 110
3434
tap_port_host , tap_port_host , tap_port_host , resource , , Universal Tag , 111 , 1 , 110

0 commit comments

Comments
 (0)