From 8a9d395e94b5dd952d1b99a968c65b0cf70769e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B3=80=EC=A0=95=ED=9B=88?= Date: Tue, 4 Jul 2023 14:10:16 +0900 Subject: [PATCH] release 3.5.2 --- .../postgres/patch/postgres_patch_3.5.2.psql | 72 +++++++++++++++++++ .../postgres/postgres_insert_dml.psql | 44 ++++++++++-- 2 files changed, 109 insertions(+), 7 deletions(-) create mode 100755 roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.2.psql diff --git a/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.2.psql b/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.2.psql new file mode 100755 index 0000000..e078e49 --- /dev/null +++ b/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.2.psql @@ -0,0 +1,72 @@ +-- Job 상태 표시를 위해 view table 생성 +CREATE VIEW v_cmoa_job AS + select Q.kube_flatting_time, Q.cluster_id, Q.metadata_ownerreferences_kind, Q.metadata_uid, K.status_phase + from (select A.kube_flatting_time as job_flatting_time, A.metadata_uid as job_metadata_uid, B.kube_flatting_time as pod_flatting_time + from (select metadata_uid, max(kube_flatting_time) as kube_flatting_time + from cmoa_job_base + where kind='Job' and kube_flatting_time > extract(epoch from (CURRENT_TIMESTAMP - INTERVAL '1 hours'))*1000 + group by metadata_uid) A, + (select metadata_ownerreferences_uid, max(kube_flatting_time) as kube_flatting_time + from cmoa_pod_base + where metadata_ownerreferences_kind='Job' and kube_flatting_time > extract(epoch from (CURRENT_TIMESTAMP - INTERVAL '1 hours'))*1000 + group by metadata_ownerreferences_uid) B + where A.metadata_uid = B.metadata_ownerreferences_uid) J + inner join cmoa_job_base Q on Q.metadata_uid = J.job_metadata_uid and Q.kube_flatting_time = J.job_flatting_time + inner join cmoa_pod_base K on K.metadata_ownerreferences_uid = J.job_metadata_uid and K.kube_flatting_time = J.pod_flatting_time + group by Q.kube_flatting_time, Q.cluster_id, Q.metadata_ownerreferences_kind, Q.metadata_uid, K.status_phase; + +-- CLOUD-17051 | Dashboard > Redis 관련 이슈 대응 +-- Auto-generated SQL script #202306011616 +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(rate(redis_cpu_sys_seconds_total[1m]), "data_type", "system", "", "") or +label_replace(rate(redis_cpu_user_seconds_total[1m]), "data_type", "user", "", "") )' + WHERE id='redis_cpu_usage'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_children_seconds_total[1m]))' + WHERE id='redis_used_cpu_sys_children'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_user_seconds_total[1m]))' + WHERE id='redis_used_cpu_user'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_user_children_seconds_total [1m]))' + WHERE id='redis_used_cpu_user_children'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_seconds_total[1m]))' + WHERE id='redis_used_cpu_sys'; + +-- CLOUD-17354 | NginX 관련 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_up','Nginx Up','Nginx Up Time','sum by (instance) (nginx_up)','State','Nginx','','true','false','"Nginx Up Time : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_accepted','Nginx Accepted Connection Count','Accepted connection count of Nginx','sum by (instance) (irate(nginx_connections_accepted[5m]))','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_handled','Nginx Handled Connection Count','Handled connection count of Nginx','sum by (instance) (irate(nginx_connections_handled[5m]))','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_active','Nginx Active Connection Count','Active connection count of Nginx','sum by (instance) (nginx_connections_active)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_reading','Nginx Reading Connection Count','Reading connection count of Nginx','sum by (instance) (nginx_connections_reading)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_waiting','Nginx Waiting Connection Count','Waiting connection count of Ngin','sum by (instance) (nginx_connections_waiting)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_writing','Nginx Writing Connection Count','Writing connection count of NginX','sum by (instance) (nginx_connections_writing)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_http_requests_total','Nginx Http Requests','Http request count of Nginx','sum by (instance) (irate(nginx_http_requests_total[1m]))','Request','Nginx','','true','false','"Http requests : {{$value}} , Threshold : {threshold}"'); + +-- CLOUD-17354 | NginX Dashboard 추가 +INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboard|admin|Nginx', false, null); +INSERT INTO public.dashboard2 (id, created_date, modified_date, layout, title, auth_resource_id, created_by, modified_by, description, "share") + VALUES(nextval('hibernate_sequence'),'2023-06-28 15:16:36.511000','2023-06-29 09:33:06.665000','[{"i":"widget1","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Accepted Connections","description":"Accepted connection count of Nginx"},"w":18,"h":11,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_accepted","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":11,"static":true},{"i":"widget2","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Handled Connections","description":"Handled connection count of Nginx"},"w":18,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_handled","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":22,"static":true},{"i":"widget3","widget":{"header":"default-header","body":"line-chart-view","title":"Active Connections","description":"Active connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_active","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":0,"y":8,"static":true},{"i":"widget4","widget":{"header":"default-header","body":"line-chart-view","title":"Waiting Connections","description":"Waiting connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_waiting","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":12,"y":8,"static":true},{"i":"widget5","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Reading Connections","description":"Reading connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_reading","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":0,"y":22,"static":true},{"i":"widget6","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Writing Connection","description":"Writing connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_writing","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":12,"y":22,"static":true},{"i":"widget7","widget":{"header":"default-header","body":"label-view","title":" "},"w":24,"h":3,"minW":2,"minH":1,"maxW":48,"maxH":36,"component":{"api":{},"visualization":{"background":null,"fontSize":20,"textAlign":"left","padding":[0,18],"sideways":false,"fontWeight":"bold","text":"Nginx Information"}},"x":0,"y":0,"static":true},{"i":"widget0","widget":{"header":"default-header","body":"stat-view","title":"Active"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_active","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":0,"y":3,"static":true},{"i":"widget8","widget":{"header":"default-header","body":"stat-view","title":"Waiting"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_waiting","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":6,"y":3,"static":true},{"i":"widget9","widget":{"header":"default-header","body":"stat-view","title":"Reading"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_reading","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":12,"y":3,"static":true},{"i":"widget10","widget":{"header":"default-header","body":"stat-view","title":"Writing"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_writing","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":18,"y":3,"static":true},{"i":"widget11","widget":{"header":"default-header","body":"line-chart-view","title":"Http Request"},"w":18,"h":11,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_http_requests_total","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":0,"static":true},{"i":"widget12","widget":{"header":"default-header","body":"stat-view","title":"Http Request"},"w":6,"h":11,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_http_requests_total","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":0,"static":true},{"i":"widget13","widget":{"header":"default-header","body":"stat-view","title":"Accepted Count"},"w":6,"h":11,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_accepted","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":11,"static":true},{"i":"widget14","widget":{"header":"default-header","body":"stat-view","title":"Handled Count"},"w":6,"h":14,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_handled","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":22,"static":true}]', + 'Nginx Dashboard',(select id from auth_resource3 where name='dashboard|admin|Nginx'),'admin','admin','Nginx Dashboard',true); + +-- CLOUD-17326 | Kube Event 관련 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_node','Kubernetes Node Event','Kubernetes Node Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Node"})','Event','Node','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_job','Kubernetes Job Event','Kubernetes Job Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Job"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_cronjob','Kubernetes CronJob Event','Kubernetes CronJob Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="CronJob"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_daemonset','Kubernetes DaemonSet Event','Kubernetes DaemonSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="DaemonSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_deployment','Kubernetes Deployment Event','Kubernetes Deployment Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Deployment"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_endpoints','Kubernetes Endpoints Event','Kubernetes Endpoints Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Endpoints"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_persistentvolumeclaim','Kubernetes PersistentVolumeClaim Event','Kubernetes PersistentVolumeClaim Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="PersistentVolumeClaim"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_pod','Kubernetes Pod Event','Kubernetes Pod Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Pod"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_warning','Kubernetes Warning Event','Kubernetes Warning Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{type="Warning"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Name: {{$involved_name}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_replicaset','Kubernetes ReplicaSet Event','Kubernetes ReplicaSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="ReplicaSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_statefulset','Kubernetes StatefulSet Event','Kubernetes StatefulSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="StatefulSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); + +-- Container 의 Limit 대비 CPU/Memory 사용량 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('container_cpu_usage_against_limit','Container CPU Usage Against Limits (%)','Conatiner CPU Usage Against Limits ( % ) ','sum by(xm_clst_id,xm_namespace,owner_name,xm_pod_id,xm_cont_name,xm_entity_type) (rate(imxc_kubernetes_container_resource_limit_cpu{xm_cont_name!="POD"} [1m])+ on (xm_clst_id,xm_namespace,xm_pod_id,xm_cont_name) group_left(owner_name) (sum (imxc_kubernetes_container_resource_limit_cpu{container_state="Running",pod_state="Running",{filter}}) without (instance)) * 0)','CPU','Workload','','true','false','CLST:{{$labels.xm_clst_id}} DP:{{$labels.owner_name}} CT:{{$labels.xm_cont_name}} PD:{{$labels.xm_pod_id}} CPU Usage (%):{{humanize $value}}%|{threshold}%.'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('container_memory_usage_against_limit','Container Memory Usage Against Limit','Container Memory Usage Against Limit','sum by(xm_clst_id,xm_namespace,xm_pod_id,xm_cont_name,xm_entity_type,owner_name) (container_memory_usage_bytes{xm_cont_name!="POD"} / on (xm_clst_id,xm_namespace,xm_cont_name,xm_pod_id) group_left(owner_name) (sum (imxc_kubernetes_container_resource_limit_memory{container_state="Running",pod_state="Running",xm_cont_name!="POD",{filter}}) without (instance))) * 100','Memory','Workload','','true','false','CLST:{{$labels.xm_clst_id}} DP:{{$labels.owner_name}} CT:{{$labels.xm_cont_name}} PD:{{$labels.xm_pod_id}} Memory Limit Against Usage:{{humanize $value}}%|{threshold}%.'); + + +commit; diff --git a/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_dml.psql b/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_dml.psql index d8cae7a..c14ee06 100755 --- a/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_dml.psql +++ b/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_dml.psql @@ -179,7 +179,7 @@ INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboa INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboard|admin|Traefik', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboard|admin|MySQL / MariaDB', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboard|admin|Nginx-Ingress', false, null); - +INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('dashboard|admin|Nginx', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('cluster|cloudmoa', false, 'DEFAULT_TENANT'); @@ -1035,13 +1035,13 @@ INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,ent label_replace(rate(oracledb_activity_user_rollbacks[1m]), "data_type", "rollbacks", "", "") or label_replace(rate(oracledb_activity_user_commits[1m]), "data_type", "commits", "", ""))','Request','OracleDB','data_type',true,false,'oracledb transaction','2020-01-29 11:20:47.000','2020-02-13 01:26:28.558'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_cpu_usage','Redis cpu usage','redis cpu usage','sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( -label_replace(rate(redis_used_cpu_sys [1m]), "data_type", "system", "", "") or -label_replace(rate(redis_used_cpu_user [1m]), "data_type", "user", "", "") )','CPU','Redis','data_type',true,false,'redis cpu usage','2020-01-29 01:56:58.000','2020-02-12 04:47:21.228'); +label_replace(rate(redis_cpu_sys_seconds_total[1m]), "data_type", "system", "", "") or +label_replace(rate(redis_cpu_user_seconds_total[1m]), "data_type", "user", "", "") )','CPU','Redis','data_type',true,false,'redis cpu usage','2020-01-29 01:56:58.000','2020-02-12 04:47:21.228'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('host_total_load','host total load','host total load','sum by (instance, data_type) ( label_replace(node_load1 {{filter}}, "data_type", "load 1", "", "") or label_replace(node_load5 {{filter}}, "data_type", "load 5", "", "") or label_replace(node_load15 {{filter}}, "data_type", "load15", "", "") )','CPU','Host',NULL,false,false,'host total load','2020-04-01 08:10:26.588','2020-04-03 01:23:47.665'); -INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_sys_children','System CPU Used Background','System CPU consumed by the background processes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_used_cpu_sys_children[1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis System CPU Used Backedground:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_sys_children','System CPU Used Background','System CPU consumed by the background processes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_children_seconds_total[1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis System CPU Used Backedground:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_keyspace_hits','Keyspace Hits','Number of successful lookup of keys in the main dictionary','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_hits_total[1m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Keyspace Hits:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_keyspace_misses','Keyspace Misses','Number of failed lookup of keys in the main dictionary','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_misses_total[1m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Keyspace Misses:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_db_keys','DB Keys Count','Total number of keys by DB','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys)','Keyspace','Redis','db',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis DB Keys Count:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); @@ -1164,7 +1164,7 @@ INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,ent INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('pod_memory_limit','pod_memory_limit (Gib)','Total container memory limit in GiB for the given pod','sum by (xm_clst_id, xm_node_id, xm_pod_id) (imxc_kubernetes_container_resource_limit_memory{{filter}}) / 1073741824','Memory','Pod',NULL,false,false,'None','2020-05-21 11:50:52.717','2020-05-21 11:50:52.717'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('container_memory_usage_bytes','Container Memory Used (GiB)','Current memory usage in GiB, this includes all memory regardless of when it was accessed','sum by (xm_clst_id,xm_pod_id,xm_cont_id,xm_cont_name,xm_entity_type,xm_namespace,xm_node_id) (container_memory_usage_bytes{xm_entity_type=''Container'',xm_cont_name!=''POD'',{filter}} / 1024 / 1024 / 1024)','Memory','Container',NULL,true,true,'CLST:{{$labels.xm_clst_id}} CONT:{{$labels.xm_cont_name}} Used Memory:{{humanize $value}}GiB|{threshold}GiB.','2019-06-05 14:27:36.000','2020-06-04 11:11:11.000'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('node_memory_used','Node Memory Used (GIB)','Node Memory Used (GIB)','((node_memory_MemTotal_bytes{xm_entity_type="Node", {filter}} - (node_memory_MemFree_bytes{xm_entity_type="Node", {filter}} + node_memory_Cached_bytes{xm_entity_type="Node", {filter}} + node_memory_Buffers_bytes{xm_entity_type="Node", {filter}})) >= 0 or node_memory_MemTotal_bytes{xm_entity_type="Node", {filter}} - node_memory_MemFree_bytes{xm_entity_type="Node", {filter}}) / 1024 / 1024 / 1024','Memory','Node',NULL,true,true,'NODE:{{$labels.xm_node_id}} Memory Used:{{humanize $value}}GiB|{threshold}GiB.','2020-05-21 01:18:06.000','2020-06-04 11:11:11.000'); -INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_user','User CPU Used','User CPU consumed by the Redis server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_used_cpu_user[1m]))','CPU','Redis',NULL,false,false,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis User CPU Used:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-05-29 09:37:22.273'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_user','User CPU Used','User CPU consumed by the Redis server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rateredis_cpu_user_seconds_total[1m]))','CPU','Redis',NULL,false,false,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis User CPU Used:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-05-29 09:37:22.273'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('container_cpu_sum_by_container','Container cpu sum by container','container cpu sum by container','sum by(xm_clst_id, data_type, xm_pod_id, xm_cont_name) (label_replace(imxc_kubernetes_container_resource_request_cpu{xm_cont_name!=''POD'',{filter}} * 0.001, "data_type", "request" , "", "") or label_replace(imxc_kubernetes_container_resource_limit_cpu{xm_cont_name!=''POD'',{filter}} * 0.001, "data_type", "limit" , "", "") or label_replace(rate(container_cpu_usage_seconds_total{xm_cont_name!=''POD'',{filter}}[1m]), "data_type", "used", "" , ""))','CPU','Container',NULL,false,false,'None','2020-05-21 06:50:49.546','2020-05-21 06:50:49.546'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('container_cpu_sum_by_pods','Container cpu sum by pod','Container cpu sum by pod','sum by(xm_clst_id, data_type, xm_pod_id) (label_replace(imxc_kubernetes_container_resource_request_cpu{{filter}} * 0.001, "data_type", "request" , "", "") or label_replace(imxc_kubernetes_container_resource_limit_cpu{{filter}} * 0.001, "data_type", "limit" , "", "") or label_replace(rate(container_cpu_usage_seconds_total{{filter}}[1m]), "data_type", "used", "" , ""))','CPU','Pod',NULL,false,false,'None','2020-05-21 06:50:49.546','2020-05-21 06:50:49.546'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('container_memory_sum_by_pods','Container memory sum by pod','Container memory sum by pod','sum by(xm_clst_id, data_type, xm_pod_id) (label_replace(imxc_kubernetes_container_resource_limit_memory{{filter}}, "data_type", "limit", "" , "") or label_replace(imxc_kubernetes_container_resource_request_memory{{filter}}, "data_type", "request", "" , "") or label_replace(container_memory_usage_bytes{{filter}}, "data_type", "used", "" , ""))','Memory','Pod',NULL,false,false,'None','2020-05-21 06:50:49.546','2020-05-21 06:50:49.546'); @@ -1224,8 +1224,8 @@ INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,ent INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('oracledb_sessions_value','Session Count','Gauge metric with count of sessions by status and type','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, status_type) (label_join(oracledb_sessions_value, "status_type", "-", "status", "type"))','Session','OracleDB','status_type',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Session Count:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-02-13 01:34:00.720'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('pg_stat_database_temp_bytes','Bytes Written to Temporary Files (KiB)','Total amount of data written to temporary files by queries in this database','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, datname) (rate(pg_stat_database_temp_bytes[1m])) / 1024','TemporaryFile','PostgreSQL','datname',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} PostgreSQL Temporary File Write Size:{{humanize $value}}|{threshold}.','2019-08-27 15:49:21.000','2019-08-27 15:49:21.000'); -INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_sys','System CPU Used','System CPU consumed by the Redis server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_used_cpu_sys[1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis System CPU Used:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); -INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_user_children','User CPU Used Background','User CPU consumed by the background processes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_used_cpu_user_children[1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis User CPU Used Background:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_sys','System CPU Used','System CPU consumed by the Redis server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_seconds_total[1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis System CPU Used:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('redis_used_cpu_user_children','User CPU Used Background','User CPU consumed by the background processes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_user_children_seconds_total [1m]))','CPU','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis User CPU Used Background:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-28 14:33:00.000'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('imxc_service_http_error_rate','Service HTTP Requests Error Rate','the number of HTTP error counts / the number of HTTP requests counts','sum by(xm_clst_id,xm_service_name,xm_entity_type,xm_namespace) (rate(imxc_service_request_milliseconds_count{xm_entity_type="Service",protocol="http",{filter}}[1m])) == 0 or sum by (xm_clst_id,xm_service_name,xm_entity_type,xm_namespace) (rate(imxc_service_errors_count{xm_entity_type="Service",protocol="http",{filter}}[1m])) / sum by (xm_clst_id,xm_service_name,xm_entity_type,xm_namespace) (rate(imxc_service_request_milliseconds_count{xm_entity_type="Service",protocol="http",{filter}}[1m]))','Request','Service',NULL,true,true,'SVC:{{$labels.xm_service_name}} Error Request Rate:{{humanize $value}}%|{threshold}%.','2019-10-15 09:37:44.000','2020-02-17 12:12:12.000'); @@ -1328,6 +1328,9 @@ INSERT INTO public.dashboard2 (id, created_date, modified_date, layout, title, a INSERT INTO public.dashboard2 (id, created_date, modified_date, layout, title, auth_resource_id, created_by, modified_by, description, "share") VALUES(nextval('hibernate_sequence'), '2020-04-28 09:23:14.286', '2020-04-28 09:23:44.213', '[{"i":"widget0","widget":{"header":"default-header","body":"stat-view","title":"Up"},"w":9,"h":9,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_nginx_up","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":null,"max":null,"decimals":2,"baseColor":"#409EFF","thresholds":[]}},"x":0,"y":0,"static":true},{"i":"widget1","widget":{"header":"default-header","body":"line-chart-view","title":"CPU Usage (%)"},"w":12,"h":9,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"nginx-ingress","metricId":"container_cpu_usage_core_by_workload","entityId":"deploymentList,nginx-ingress-nginx-ingress","type":"workload"}},"visualization":{"showLegend":true}},"x":0,"y":9,"static":true},{"i":"widget2","widget":{"header":"default-header","body":"line-chart-view","title":"Memory Usage (GiB)"},"w":12,"h":9,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"nginx-ingress","metricId":"container_memory_usage_by_workload","entityId":"deploymentList,nginx-ingress-nginx-ingress","type":"workload"}},"visualization":{"showLegend":true}},"x":12,"y":9,"static":true},{"i":"widget3","widget":{"header":"default-header","body":"stat-view","title":"Connected Clients Count"},"w":10,"h":9,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_nginx_connections_active","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":null,"max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[],"showLegend":true}},"x":9,"y":0,"static":true},{"i":"widget4","widget":{"header":"default-header","body":"line-chart-view","title":"Network Transmit (KB)"},"w":12,"h":9,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"nginx-ingress","metricId":"container_network_transmit_by_workload","entityId":"deploymentList,nginx-ingress-nginx-ingress","type":"workload"}},"visualization":{"showLegend":true}},"x":24,"y":9,"static":true},{"i":"widget5","widget":{"header":"default-header","body":"line-chart-view","title":"Network Recieved (KiB)"},"w":12,"h":9,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"nginx-ingress","metricId":"container_network_receive_by_workload","entityId":"deploymentList,nginx-ingress-nginx-ingress","type":"workload"}},"visualization":{"showLegend":true}},"x":36,"y":9,"static":true},{"i":"widget6","widget":{"header":"default-header","body":"stat-view","title":"Nginx Ingress last reload status"},"w":10,"h":9,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_controller_nginx_last_reload_status","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":null,"max":null,"decimals":2,"baseColor":"#409EFF","thresholds":[],"showLegend":true}},"x":19,"y":0,"static":true},{"i":"widget7","widget":{"header":"default-header","body":"stat-view","title":"Nginx Ingress reload success total"},"w":10,"h":9,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_controller_nginx_reloads_total","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":null,"max":null,"decimals":2,"baseColor":"#409EFF","thresholds":[]}},"x":29,"y":0,"static":true},{"i":"widget8","widget":{"header":"default-header","body":"stat-view","title":"Nginx Ingress reload error total"},"w":9,"h":9,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_controller_nginx_reload_errors_total","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":null,"max":null,"decimals":2,"baseColor":"#409EFF","thresholds":[]}},"x":39,"y":0,"static":true},{"i":"widget10","widget":{"header":"default-header","body":"line-chart-view","title":"Nginx Ingress Http Request Seconds"},"w":48,"h":15,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_ingress_nginx_http_requests_second","entityId":"","type":"Nginx-Ingress","filter":""}},"visualization":{"showLegend":true}},"x":0,"y":18,"static":true}]', 'Nginx-Ingress', (select id from auth_resource3 where name='dashboard|admin|Nginx-Ingress'), 'admin', 'admin', NULL, true); +INSERT INTO public.dashboard2 (id, created_date, modified_date, layout, title, auth_resource_id, created_by, modified_by, description, "share") + VALUES(nextval('hibernate_sequence'), '2020-04-28 09:23:14.286', '2020-04-28 09:23:44.213', '[{"i":"widget1","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Accepted Connections","description":"Accepted connection count of Nginx"},"w":18,"h":11,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_accepted","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":11,"static":true},{"i":"widget2","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Handled Connections","description":"Handled connection count of Nginx"},"w":18,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_handled","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":22,"static":true},{"i":"widget3","widget":{"header":"default-header","body":"line-chart-view","title":"Active Connections","description":"Active connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_active","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":0,"y":8,"static":true},{"i":"widget4","widget":{"header":"default-header","body":"line-chart-view","title":"Waiting Connections","description":"Waiting connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_waiting","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":12,"y":8,"static":true},{"i":"widget5","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Reading Connections","description":"Reading connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_reading","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":0,"y":22,"static":true},{"i":"widget6","widget":{"header":"default-header","body":"stack-bar-chart-view","title":"Writing Connection","description":"Writing connection count of Nginx"},"w":12,"h":14,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_writing","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":12,"y":22,"static":true},{"i":"widget7","widget":{"header":"default-header","body":"label-view","title":" "},"w":24,"h":3,"minW":2,"minH":1,"maxW":48,"maxH":36,"component":{"api":{},"visualization":{"background":null,"fontSize":20,"textAlign":"left","padding":[0,18],"sideways":false,"fontWeight":"bold","text":"Nginx Information"}},"x":0,"y":0,"static":true},{"i":"widget0","widget":{"header":"default-header","body":"stat-view","title":"Active"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_active","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":0,"y":3,"static":true},{"i":"widget8","widget":{"header":"default-header","body":"stat-view","title":"Waiting"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_waiting","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":6,"y":3,"static":true},{"i":"widget9","widget":{"header":"default-header","body":"stat-view","title":"Reading"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_reading","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":12,"y":3,"static":true},{"i":"widget10","widget":{"header":"default-header","body":"stat-view","title":"Writing"},"w":6,"h":5,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_writing","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":18,"y":3,"static":true},{"i":"widget11","widget":{"header":"default-header","body":"line-chart-view","title":"Http Request"},"w":18,"h":11,"minW":8,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":false,"range":true,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_http_requests_total","entityId":"","type":"Nginx","filter":""}},"visualization":{"showLegend":true}},"x":30,"y":0,"static":true},{"i":"widget12","widget":{"header":"default-header","body":"stat-view","title":"Http Request"},"w":6,"h":11,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_http_requests_total","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":0,"static":true},{"i":"widget13","widget":{"header":"default-header","body":"stat-view","title":"Accepted Count"},"w":6,"h":11,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_accepted","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":11,"static":true},{"i":"widget14","widget":{"header":"default-header","body":"stat-view","title":"Handled Count"},"w":6,"h":14,"minW":6,"minH":4,"maxW":48,"maxH":18,"component":{"api":{"uri":"metric.chart","params":{"unique":true,"range":false,"clusterId":"cloudmoa","namespace":"","metricId":"nginx_connections_handled","entityId":"","type":"Nginx","filter":""}},"visualization":{"showGauge":false,"showPercent":false,"min":"0","max":null,"decimals":null,"baseColor":"#409EFF","thresholds":[]}},"x":24,"y":22,"static":true}]', + 'Nginx Dashboard',(select id from auth_resource3 where name='dashboard|admin|Nginx'),'admin','admin','Nginx Dashboard',true); INSERT INTO public.common_setting (code_id, code_value, code_desc, code_auth, code_group, created_date, modified_date) VALUES ('normal_score', '20', null, null, 'anomaly', '2020-07-07 18:15:55.000000', '2020-07-07 18:15:53.000000'); @@ -2488,3 +2491,30 @@ INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,ent INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_ingress_controller_nginx_reloads_total','Nginx Ingress reload success total','Number of successful NGINX reloads','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, class) (nginx_ingress_controller_nginx_reloads_total)','Config','Nginx-Ingress','',true,false,'None'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_ingress_nginx_http_requests_total','Nginx Ingress Http Request Total','Total http requests','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, class) (nginx_ingress_nginx_http_requests_total)','Request','Nginx-Ingress','',true,false,'None'); INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_ingress_nginx_http_requests_second','Nginx Ingress Http Request Seconds','Http request per second','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, class) (rate(nginx_ingress_nginx_http_requests_total[1m]))','Request','Nginx-Ingress','',true,false,'None'); + +-- Nginx 대시보드 지원 관련 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_up','Nginx Up','Nginx Up Time','sum by (instance) (nginx_up)','State','Nginx','','true','false','"Nginx Up Time : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_accepted','Nginx Accepted Connection Count','Accepted connection count of Nginx','sum by (instance) (irate(nginx_connections_accepted[5m]))','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_handled','Nginx Handled Connection Count','Handled connection count of Nginx','sum by (instance) (irate(nginx_connections_handled[5m]))','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_active','Nginx Active Connection Count','Active connection count of Nginx','sum by (instance) (nginx_connections_active)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_reading','Nginx Reading Connection Count','Reading connection count of Nginx','sum by (instance) (nginx_connections_reading)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_waiting','Nginx Waiting Connection Count','Waiting connection count of Ngin','sum by (instance) (nginx_connections_waiting)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_connections_writing','Nginx Writing Connection Count','Writing connection count of NginX','sum by (instance) (nginx_connections_writing)','Connection','Nginx','','true','false','"Nginx Connection : {{$value}} , Threshold : {threshold}"'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('nginx_http_requests_total','Nginx Http Requests','Http request count of Nginx','sum by (instance) (irate(nginx_http_requests_total[1m]))','Request','Nginx','','true','false','"Http requests : {{$value}} , Threshold : {threshold}"'); + +-- Kube Event 관련 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_node','Kubernetes Node Event','Kubernetes Node Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Node"})','Event','Node','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_job','Kubernetes Job Event','Kubernetes Job Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Job"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_cronjob','Kubernetes CronJob Event','Kubernetes CronJob Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="CronJob"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_daemonset','Kubernetes DaemonSet Event','Kubernetes DaemonSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="DaemonSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_deployment','Kubernetes Deployment Event','Kubernetes Deployment Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Deployment"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_endpoints','Kubernetes Endpoints Event','Kubernetes Endpoints Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Endpoints"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_persistentvolumeclaim','Kubernetes PersistentVolumeClaim Event','Kubernetes PersistentVolumeClaim Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="PersistentVolumeClaim"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_pod','Kubernetes Pod Event','Kubernetes Pod Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="Pod"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_warning','Kubernetes Warning Event','Kubernetes Warning Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{type="Warning"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Name: {{$involved_name}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_replicaset','Kubernetes ReplicaSet Event','Kubernetes ReplicaSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="ReplicaSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('kube_event_statefulset','Kubernetes StatefulSet Event','Kubernetes StatefulSet Event','count by (xm_clst_id,xm_namespace,entity_type,involved_kind,involved_name,reason,type) (imxc_kubernetes_event_in_last_min{involved_kind="StatefulSet"})','Event','Workload','','true','false','CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Reason : {{$labels.reason}} Level : {{$labels.type}} '); + +-- Container 의 Limit 대비 CPU/Memory 사용량 metric meta 추가 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('container_cpu_usage_against_limit','Container CPU Usage Against Limits (%)','Conatiner CPU Usage Against Limits ( % ) ','sum by(xm_clst_id,xm_namespace,owner_name,xm_pod_id,xm_cont_name,xm_entity_type) (rate(imxc_kubernetes_container_resource_limit_cpu{xm_cont_name!="POD"} [1m])+ on (xm_clst_id,xm_namespace,xm_pod_id,xm_cont_name) group_left(owner_name) (sum (imxc_kubernetes_container_resource_limit_cpu{container_state="Running",pod_state="Running",{filter}}) without (instance)) * 0)','CPU','Workload','','true','false','CLST:{{$labels.xm_clst_id}} DP:{{$labels.owner_name}} CT:{{$labels.xm_cont_name}} PD:{{$labels.xm_pod_id}} CPU Usage (%):{{humanize $value}}%|{threshold}%.'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message) VALUES('container_memory_usage_against_limit','Container Memory Usage Against Limit','Container Memory Usage Against Limit','sum by(xm_clst_id,xm_namespace,xm_pod_id,xm_cont_name,xm_entity_type,owner_name) (container_memory_usage_bytes{xm_cont_name!="POD"} / on (xm_clst_id,xm_namespace,xm_cont_name,xm_pod_id) group_left(owner_name) (sum (imxc_kubernetes_container_resource_limit_memory{container_state="Running",pod_state="Running",xm_cont_name!="POD",{filter}}) without (instance))) * 100','Memory','Workload','','true','false','CLST:{{$labels.xm_clst_id}} DP:{{$labels.owner_name}} CT:{{$labels.xm_cont_name}} PD:{{$labels.xm_pod_id}} Memory Limit Against Usage:{{humanize $value}}%|{threshold}%.');