-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* db_type support * metric expression * rm service_node from jvm_memory and nodejs_memory
- Loading branch information
1 parent
adc81ff
commit 01e3901
Showing
3 changed files
with
22 additions
and
36 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
.erda/migrations/monitor/20210923-sp_metric_expression.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"alias\":\"application_cache_service\"%") AS `ids`); | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"alias\":\"application_db_service\"%") AS `ids`); | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"alias\":\"application_http_service\"%") AS `ids`); | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"alias\":\"application_mq_service\"%") AS `ids`); | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"alias\":\"application_rpc_service\"%") AS `ids`); | ||
|
||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"metric\":\"jvm_memory\"%") AS `ids`); | ||
UPDATE `sp_metric_expression` SET `enable` = 0 WHERE `id` = (SELECT `id` FROM (SELECT `id` FROM `sp_metric_expression` WHERE `enable` = 1 AND `expression` LIKE "%\"metric\":\"nodejs_memory\"%") AS `ids`); | ||
|
||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"application_cache_service\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"elapsed\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_mean * field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_count; }\"}],\"group\":[\"host\",\"source_terminus_key\",\"source_application_id\",\"source_runtime_name\",\"source_service_name\",\"source_addon_id\"],\"metric\":\"application_cache\",\"outputs\":[\"metric\"],\"select\":{\"cluster_name\":\"#cluster_name\",\"component\":\"#component\",\"db_type\":\"#db_type\",\"host\":\"#host\",\"source_addon_id\":\"#source_addon_id\",\"source_addon_type\":\"#source_addon_type\",\"source_application_id\":\"#source_application_id\",\"source_application_name\":\"#source_application_name\",\"source_project_id\":\"#source_project_id\",\"source_project_name\":\"#source_project_name\",\"source_runtime_id\":\"#source_runtime_id\",\"source_runtime_name\":\"#source_runtime_name\",\"source_service_id\":\"#source_service_id\",\"source_service_name\":\"#source_service_name\",\"source_terminus_key\":\"#source_terminus_key\",\"source_workspace\":\"#source_workspace\"},\"window\":3}","3.0"); | ||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"application_db_service\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"elapsed\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_mean * field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_count; }\"}],\"group\":[\"host\",\"source_terminus_key\",\"source_application_id\",\"source_runtime_name\",\"source_service_name\",\"source_addon_id\"],\"metric\":\"application_db\",\"outputs\":[\"metric\"],\"select\":{\"cluster_name\":\"#cluster_name\",\"component\":\"#component\",\"db_type\":\"#db_type\",\"host\":\"#host\",\"source_addon_id\":\"#source_addon_id\",\"source_addon_type\":\"#source_addon_type\",\"source_application_id\":\"#source_application_id\",\"source_application_name\":\"#source_application_name\",\"source_project_id\":\"#source_project_id\",\"source_project_name\":\"#source_project_name\",\"source_runtime_id\":\"#source_runtime_id\",\"source_runtime_name\":\"#source_runtime_name\",\"source_service_id\":\"#source_service_id\",\"source_service_name\":\"#source_service_name\",\"source_terminus_key\":\"#source_terminus_key\",\"source_workspace\":\"#source_workspace\"},\"window\":3}","3.0"); | ||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"application_http_service\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"elapsed\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_mean * field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"errors\",\"field_script\":\"function invoke(field, tag){ return tag.error=='true'?field.elapsed_count:0; }\"}],\"group\":[\"host\",\"req_host\",\"target_terminus_key\",\"target_application_id\",\"target_runtime_name\",\"target_service_name\",\"target_addon_id\",\"source_terminus_key\",\"source_application_id\",\"source_runtime_name\",\"source_service_name\",\"source_addon_id\"],\"metric\":\"application_http\",\"outputs\":[\"metric\"],\"select\":{\"cluster_name\":\"#cluster_name\",\"component\":\"#component\",\"db_type\":\"#db_type\",\"host\":\"#host\",\"peer_service_scope\":\"#peer_service_scope\",\"req_host\":\"#req_host\",\"source_addon_id\":\"#source_addon_id\",\"source_addon_type\":\"#source_addon_type\",\"source_application_id\":\"#source_application_id\",\"source_application_name\":\"#source_application_name\",\"source_project_id\":\"#source_project_id\",\"source_project_name\":\"#source_project_name\",\"source_runtime_id\":\"#source_runtime_id\",\"source_runtime_name\":\"#source_runtime_name\",\"source_service_id\":\"#source_service_id\",\"source_service_name\":\"#source_service_name\",\"source_terminus_key\":\"#source_terminus_key\",\"source_workspace\":\"#source_workspace\",\"target_addon_id\":\"#target_addon_id\",\"target_addon_type\":\"#target_addon_type\",\"target_application_id\":\"#target_application_id\",\"target_application_name\":\"#target_application_name\",\"target_instance_id\":\"#target_instance_id\",\"target_project_id\":\"#target_project_id\",\"target_project_name\":\"#target_project_name\",\"target_runtime_name\":\"#target_runtime_name\",\"target_service_id\":\"#target_service_id\",\"target_service_name\":\"#target_service_name\",\"target_terminus_key\":\"#target_terminus_key\",\"target_workspace\":\"#target_workspace\"},\"window\":3}","3.0"); | ||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"application_mq_service\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"elapsed\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_mean * field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_count; }\"}],\"group\":[\"host\",\"target_terminus_key\",\"target_application_id\",\"target_runtime_name\",\"target_service_name\",\"target_addon_id\",\"source_terminus_key\",\"source_application_id\",\"source_runtime_name\",\"source_service_name\",\"source_addon_id\"],\"metric\":\"application_mq\",\"outputs\":[\"metric\"],\"select\":{\"cluster_name\":\"#cluster_name\",\"component\":\"#component\",\"db_type\":\"#db_type\",\"host\":\"#host\",\"source_addon_id\":\"#source_addon_id\",\"source_addon_type\":\"#source_addon_type\",\"source_application_id\":\"#source_application_id\",\"source_application_name\":\"#source_application_name\",\"source_project_id\":\"#source_project_id\",\"source_project_name\":\"#source_project_name\",\"source_runtime_id\":\"#source_runtime_id\",\"source_runtime_name\":\"#source_runtime_name\",\"source_service_id\":\"#source_service_id\",\"source_service_name\":\"#source_service_name\",\"source_terminus_key\":\"#source_terminus_key\",\"source_workspace\":\"#source_workspace\",\"target_addon_id\":\"#target_addon_id\",\"target_addon_type\":\"#target_addon_type\",\"target_application_id\":\"#target_application_id\",\"target_application_name\":\"#target_application_name\",\"target_instance_id\":\"#target_instance_id\",\"target_project_id\":\"#target_project_id\",\"target_project_name\":\"#target_project_name\",\"target_runtime_name\":\"#target_runtime_name\",\"target_service_id\":\"#target_service_id\",\"target_service_name\":\"#target_service_name\",\"target_terminus_key\":\"#target_terminus_key\",\"target_workspace\":\"#target_workspace\"},\"window\":3}","3.0"); | ||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"application_rpc_service\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"elapsed\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_mean * field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return field.elapsed_count; }\"},{\"aggregator\":\"sum\",\"field\":\"errors\",\"field_script\":\"function invoke(field, tag){ return tag.error=='true'?field.elapsed_count:0; }\"}],\"group\":[\"host\",\"target_terminus_key\",\"target_application_id\",\"target_runtime_name\",\"target_service_name\",\"target_addon_id\",\"source_terminus_key\",\"source_application_id\",\"source_runtime_name\",\"source_service_name\",\"source_addon_id\"],\"metric\":\"application_rpc\",\"outputs\":[\"metric\"],\"select\":{\"cluster_name\":\"#cluster_name\",\"component\":\"#component\",\"db_type\":\"#db_type\",\"host\":\"#host\",\"peer_service_scope\":\"#peer_service_scope\",\"source_addon_id\":\"#source_addon_id\",\"source_addon_type\":\"#source_addon_type\",\"source_application_id\":\"#source_application_id\",\"source_application_name\":\"#source_application_name\",\"source_project_id\":\"#source_project_id\",\"source_project_name\":\"#source_project_name\",\"source_runtime_id\":\"#source_runtime_id\",\"source_runtime_name\":\"#source_runtime_name\",\"source_service_id\":\"#source_service_id\",\"source_service_name\":\"#source_service_name\",\"source_terminus_key\":\"#source_terminus_key\",\"source_workspace\":\"#source_workspace\",\"target_addon_id\":\"#target_addon_id\",\"target_addon_type\":\"#target_addon_type\",\"target_application_id\":\"#target_application_id\",\"target_application_name\":\"#target_application_name\",\"target_instance_id\":\"#target_instance_id\",\"target_project_id\":\"#target_project_id\",\"target_project_name\":\"#target_project_name\",\"target_runtime_name\":\"#target_runtime_name\",\"target_service_id\":\"#target_service_id\",\"target_service_name\":\"#target_service_name\",\"target_terminus_key\":\"#target_terminus_key\",\"target_workspace\":\"#target_workspace\"},\"window\":3}","3.0"); | ||
INSERT `sp_metric_expression`(`attributes`,`expression`,`version`) VALUES("{}","{\"alias\":\"service_node\",\"filter\":{},\"functions\":[{\"aggregator\":\"sum\",\"field\":\"count\",\"field_script\":\"function invoke(field, tag){ return 1; }\"}],\"group\":[\"terminus_key\",\"msp_env_id\",\"service_id\"],\"metric\":\"application_service_node\",\"outputs\":[\"metric\"],\"select\":{\"application_name\":\"#application_name\",\"instrumentation_library\":\"#instrumentation_library\",\"instrumentation_library_version\":\"#instrumentation_library_version\",\"msp_env_id\":\"#msp_env_id\",\"project_name\":\"#project_name\",\"runtime_id\":\"#runtime_id\",\"runtime_name\":\"#runtime_name\",\"service_id\":\"#service_id\",\"service_name\":\"#service_name\",\"terminus_key\":\"#terminus_key\",\"workspace\":\"#workspace\"},\"window\":2}","3.0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters