diff --git a/cmoa_pgpatch.yaml b/cmoa_pgpatch.yaml index efa4ce4..affe50c 100755 --- a/cmoa_pgpatch.yaml +++ b/cmoa_pgpatch.yaml @@ -2,14 +2,10 @@ - hosts: cluster become: true gather_facts: true - environment: - KUBECONFIG: /root/.kube/ansible_config vars: cmoa_namespace: imxc pg_version: - - 3.5.2 - - 3.5.3 - - 3.5.4 + - 3.5.5 roles: - role: cmoa_pgpatch delegate_to: 127.0.0.1 diff --git a/installer.sh b/installer.sh index b9e379d..77c9a7e 100755 --- a/installer.sh +++ b/installer.sh @@ -28,7 +28,7 @@ select_menu() { do printf "$ESC[2K$(check_selected $i $SELECTED) $i. ${!i}\n"; done - printf "\n$ESC[2KCMOA\nVersion: 3.5.4\n"; + printf "\n$ESC[2KCMOA\nVersion: 3.5.5\n"; INPUT=$(input_key); if [[ $INPUT = "" ]]; then break; diff --git a/inventory b/inventory index a355de5..fdb15b0 100755 --- a/inventory +++ b/inventory @@ -1,11 +1,11 @@ [master] -10.10.43.246 +10.10.43.210 [worker1] -10.10.43.247 +10.10.43.211 [worker2] -10.10.43.248 +10.10.43.212 [cluster:children] master diff --git a/roles/cmoa_install/defaults/main.yml b/roles/cmoa_install/defaults/main.yml index 700df0c..dbe1ed1 100644 --- a/roles/cmoa_install/defaults/main.yml +++ b/roles/cmoa_install/defaults/main.yml @@ -4,7 +4,7 @@ helm_version: v3.10.3 # cmoa info cmoa_namespace: imxc -cmoa_version: rel3.5.4 +cmoa_version: rel3.5.5 # files/00-default in role docker_secret_file: secret_nexus.yaml diff --git a/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.5.psql b/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.5.psql new file mode 100644 index 0000000..c185527 --- /dev/null +++ b/roles/cmoa_install/files/03-ddl-dml/postgres/patch/postgres_patch_3.5.5.psql @@ -0,0 +1,673 @@ +-- CLOUD-20862 | Topology Agent | 리더 선출 로직 개선 +-- Auto-generated SQL script #202310121749 +UPDATE public.agent_install_file_info + SET yaml='--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cloudmoa-cluster-role +rules: + - nonResourceURLs: + - "*" + verbs: + - get + - apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - pods + verbs: + - get + - list + - watch + - update + - apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch + - update + - apiGroups: + - "" + resources: + - nodes/stats + - endpoints + - namespaces + - events + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - daemonsets + - deployments + - deployments/scale + - replicasets + - replicasets/scale + - statefulsets + - statefulsets/scale + verbs: + - get + - list + - watch + - update + - apiGroups: + - batch + resources: + - jobs + verbs: + - get + - list + - watch + - update + - apiGroups: + - batch + resources: + - cronjobs + verbs: + - get + - list + - update + - apiGroups: + - storage.j8s.io + resources: + - storageclasses + verbs: + - get + - list + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - apiGroups: + - extensions + resources: + - ingresses + verbs: + - get + - list + - apiGroups: + - policy + resources: + - podsecuritypolicies + verbs: + - use + resourceNames: + - imxc-ps + - apiGroups: + - certificates.k8s.io + resourceNames: + - kubernetes.io/kube-apiserver-client-kubelet + resources: + - signers + verbs: + - approve + - apiGroups: + - certificates.k8s.io + resourceNames: + - kubernetes.io/kubelet-serving + resources: + - signers + verbs: + - approve + - apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch + - proxy + - apiGroups: + - "" + resources: + - nodes/log + - nodes/metrics + - nodes/proxy + - nodes/spec + - nodes/stats + verbs: + - ''*'' + - apiGroups: + - ''*'' + resources: + - ''*'' + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cloudmoa-restricted-rb + namespace: $CLOUDMOA_NAMESPACE +subjects: + - kind: ServiceAccount + name: default + namespace: $CLOUDMOA_NAMESPACE +roleRef: + kind: ClusterRole + name: cloudmoa-cluster-role + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: cloudmoa-psp + namespace: $CLOUDMOA_NAMESPACE +spec: + privileged: true + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + runAsUser: + rule: RunAsAny + fsGroup: + rule: RunAsAny + hostPorts: + - max: 65535 + min: 0 + hostNetwork: true + hostPID: true + volumes: + - configMap + - secret + - emptyDir + - hostPath + - projected + - downwardAPI + - persistentVolumeClaim +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: cloudmoa-topology-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: cloudmoa-topology-agent +spec: + selector: + matchLabels: + app: cloudmoa-topology-agent + template: + metadata: + labels: + app: cloudmoa-topology-agent + spec: + hostNetwork: true + hostPID: true + tolerations: + - effect: NoSchedule + operator: Exists + - effect: NoExecute + operator: Exists + containers: + - image: $DOCKER_REGISTRY_URL/node-exporter + name: node-agent + resources: + limits: + cpu: 250m + memory: 180Mi + requests: + cpu: 125m + memory: 90Mi + ports: + - containerPort: 9110 + hostPort: 9110 + name: scrape + args: + - --path.procfs=/host/proc + - --path.sysfs=/host/sys + - --path.rootfs=/host/root + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) + - --collector.tcpstat + - --web.listen-address=:9110 + # --log.level=debug + env: + - name: GOMAXPROCS + value: "1" + volumeMounts: + - mountPath: /host/proc + name: proc-volume + readOnly: false + - mountPath: /host/sys + name: sys-volume + readOnly: false + - mountPath: /host/root + mountPropagation: HostToContainer + name: root-volume + readOnly: true + - name: cloudmoa-topology-agent + image: $DOCKER_REGISTRY_URL/topology-agent:$IMAGE_TAG + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 500m + memory: 600Mi + securityContext: + privileged: true + volumeMounts: + - mountPath: /host/usr/bin + name: bin-volume + - mountPath: /var/run/docker.sock + name: docker-volume + - mountPath: /host/proc + name: proc-volume + - mountPath: /root + name: root-volume + - mountPath: /log + name: log-volume + env: + - name: DATAGATE + value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT + - name: CLUSTER_ID + value: $CLOUDMOA_CLUSTER_ID + - name: ROOT_DIRECTORY + value: /root + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: POD_ID + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: LOG_LEVEL + value: "INFO" + livenessProbe: + httpGet: + path: /healthz + port: 18081 + initialDelaySeconds: 30 + timeoutSeconds: 5 + volumes: + - name: bin-volume + hostPath: + path: /usr/bin + type: Directory + - name: docker-volume + hostPath: + path: /var/run/docker.sock + - name: proc-volume + hostPath: + path: /proc + - name: root-volume + hostPath: + path: / + - hostPath: + path: /sys + name: sys-volume + - name: log-volume + hostPath: + path: /home' + WHERE id=2; + +-- CLOUD-18687 otel-trace agent 추가 +INSERT INTO public.agent_install_file_info (id, name, type, description, version, yaml, use_yn, created_date, + modified_date) +VALUES (8, 'otel-trace', 'agent', + 'CloudMOA에서는 고객사에서 운영 중인 application의 TPS, 서비스 연관관계 등의 데이터를 얻기 위해서 Opentelemetry를 사용하며, Opentelemetry 사용을 위해 애플리케이션의 instrumentation이 필요합니다.', + null, '--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + selector: + matchLabels: + app: otel-trace-agent + template: + metadata: + labels: + app: otel-trace-agent + spec: + containers: + - image: $DOCKER_REGISTRY_URL/otel-trace-agent:$IMAGE_TAG + imagePullPolicy: Always + name: otel-trace-agent + resources: + requests: + cpu: 100m + memory: 50Mi + limits: + cpu: 200m + memory: 100Mi + ports: + - containerPort: 4317 + protocol: TCP + env: + - name: CMOA_LOG_LEVEL + value: "INFO" + - name: CMOA_CLUSTER_ID + value: $CLOUDMOA_CLUSTER_ID + - name: CMOA_DATAGATE + value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT + volumeMounts: + - name: config + mountPath: /CloudMOA/default_config.yaml + subPath: default_config.yaml + volumes: + - name: config + configMap: + name: otel-trace-agent-config + items: + - key: config.yaml + path: default_config.yaml + +--- + +apiVersion: v1 +kind: Service +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + ports: + - name: otel-port + port: 4317 + protocol: TCP + targetPort: 4317 + selector: + app: otel-trace-agent + type: ClusterIP + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: otel-trace-agent-config + namespace: $CLOUDMOA_NAMESPACE +data: + config.yaml: | + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + processors: + batch: + probabilistic_sampler: + hash_seed: 22 + sampling_percentage: 100 + exporters: + # cmoaexporter 설정 + cmoaexporter: + api: + endpoint: "127.0.0.1:7070" + traces: + endpoint: "127.0.0.1:7070" + tls: + enable: false + skip_host_verify: true + ca_file: "" + cert_file: "" + key_file: "" + queue: + enabled: true + service: + pipelines: + traces: + receivers: [otlp] + processors: [batch, probabilistic_sampler] + exporters: [cmoaexporter]'); + +-- CLOUD-21306 | Redis Metric Meta 패치 +-- Auto-generated SQL script #202310171617 +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_misses_total{{filter}}[5m]))' + WHERE id='redis_keyspace_misses'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_hits_total{{filter}}[5m]))' + WHERE id='redis_keyspace_hits'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_connections_received_total{{filter}}[5m]))' + WHERE id='redis_connections_received'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_children_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_sys_children'; +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{{filter}}[5m]), "data_type", "system", "", "") or +label_replace(rate(redis_cpu_user_seconds_total{{filter}}[5m]), "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_user_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_user'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_slaves{{filter}})' + WHERE id='redis_connected_slaves'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_total{{filter}}[5m]))' + WHERE id='redis_commands_total'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_memory_used_bytes{{filter}}) / 1048576' + WHERE id='redis_memory_used_size'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_resident_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_resident_size'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_sys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_user_children_seconds_total{{filter}} [5m]))' + WHERE id='redis_used_cpu_user_children'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_up{{filter}})' + WHERE id='redis_up'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_allocated_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_allocated_size'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(rate(redis_connections_received_total{{filter}} [5m]), "data_type", "received connections", "", "") or +label_replace(rate(redis_rejected_connections_total{{filter}} [5m]), "data_type", "rejected connections", "", "") or +label_replace(redis_connected_clients{{filter}}, "data_type", "connected clients", "", "") or +label_replace(redis_blocked_clients{{filter}}, "data_type", "blocked clients", "", "") )' + WHERE id='count_by_connection_type'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(redis_allocator_active_bytes{{filter}} / 1048576, "data_type", "active", "" , "") or +label_replace(redis_memory_used_bytes{{filter}} / 1048576, "data_type", "used", "" , "") or +label_replace(redis_allocator_allocated_bytes{{filter}} / 1048576, "data_type", "allocated", "" , "") or +label_replace(redis_allocator_resident_bytes{{filter}} / 1048576, "data_type", "resident", "" , "") )' + WHERE id='redis_memory_total'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_duration_seconds_total{{filter}}[5m]) * 1000)' + WHERE id='redis_commands_duration_seconds'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_rejected_connections_total{{filter}}[5m]))' + WHERE id='redis_rejected_connections'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_blocked_clients{{filter}})' + WHERE id='redis_blocked_clients'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_offset_bytes{{filter}}[5m]))' + WHERE id='redis_connected_slave_offset_bytes'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys_expiring{{filter}})' + WHERE id='redis_db_keys_expiring'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_evicted_keys_total{{filter}}[5m]))' + WHERE id='redis_evicted_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_clients{{filter}})' + WHERE id='redis_connected_clients'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_lag_seconds{{filter}}[5m]))' + WHERE id='redis_connected_slave_lag_seconds'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(rate(redis_keyspace_hits_total{{filter}} [5m]), "data_type", "hits", "" , "") or +label_replace(rate(redis_keyspace_misses_total{{filter}} [5m]), "data_type", "misses", "" , "") )' + WHERE id='redis_key_hit_raito'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_commands_processed_total{{filter}}[5m]))' + WHERE id='redis_commands_processed'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_expired_keys_total{{filter}}[5m]))' + WHERE id='redis_expired_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys{{filter}})' + WHERE id='redis_db_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_active_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_active_size'; + +-- Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_oomkilled','OOMKilled of Pods By Workload','OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id',TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); +-- Last Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_last_oomkilled','Last OOMKilled of Pods By Workload','Last OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_last_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id', TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); + +-- Configuration Menu 추가 +INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Configuration', (select id from auth_resource2 where type='menu' and name='Workloads'), 'menu'); +INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Configuration', false, null); +INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (16, 'Pods', NULL, 9, 'configurationWorkloads', (select id from auth_resource3 where name='menu|Workloads|Configuration'), 3); + + +-- log parsing 관련 metric meta rate연산 삭제 +UPDATE metric_meta2 SET expr = 'count by (xm_clst_id, xm_node_id, xm_namespace, xm_pod_id, xm_regex) (log_metric_counter_cmoa_metric{{filter}})' WHERE id = 'count_pod_log_parsing'; + +CREATE TABLE "intermax" ( + "cluster_id" VARCHAR(128) NOT NULL, + "namespace" VARCHAR(128) NOT NULL, + "url" VARCHAR(256) NULL DEFAULT NULL, + "service_name" VARCHAR(128) NULL DEFAULT NULL, + PRIMARY KEY ("cluster_id", "namespace") +); + +-- Configuration Table 생성 + +CREATE TABLE "cmoa_storageclass_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "provisioner" TEXT NULL DEFAULT NULL, + "reclaimpolicy" TEXT NULL DEFAULT NULL, + "volumebindingmode" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_ingress_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "spec_rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrole_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_labels" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_role_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_rolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_serviceaccount_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "secrets" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); +commit; diff --git a/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_ddl.psql b/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_ddl.psql index 1453be5..02903a0 100644 --- a/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_ddl.psql +++ b/roles/cmoa_install/files/03-ddl-dml/postgres/postgres_insert_ddl.psql @@ -1792,3 +1792,112 @@ create table public.audit_log target jsonb ); +CREATE TABLE "intermax" ( + "cluster_id" VARCHAR(128) NOT NULL, + "namespace" VARCHAR(128) NOT NULL, + "url" VARCHAR(256) NULL DEFAULT NULL, + "service_name" VARCHAR(128) NULL DEFAULT NULL, + PRIMARY KEY ("cluster_id", "namespace") +); + +-- Configuration Table 생성 + +CREATE TABLE "cmoa_storageclass_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "provisioner" TEXT NULL DEFAULT NULL, + "reclaimpolicy" TEXT NULL DEFAULT NULL, + "volumebindingmode" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_ingress_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "spec_rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrole_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_labels" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_role_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_rolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_serviceaccount_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "secrets" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); 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 9582c36..e200e8d 100644 --- 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 @@ -26,6 +26,7 @@ INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4 INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Jobs', (select id from auth_resource2 where type='menu' and name='Workloads') , 'menu'); -- INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Cron Jobs', (select id from auth_resource2 where type='menu' and name='Workloads') , 'menu'); INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Deploy List', (select id from auth_resource2 where type='menu' and name='Workloads'), 'menu'); +INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Configuration', (select id from auth_resource2 where type='menu' and name='Workloads'), 'menu'); INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Topology', (select id from auth_resource2 where type='menu' and name='Services') , 'menu'); INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Structure', (select id from auth_resource2 where type='menu' and name='Services') , 'menu'); @@ -102,6 +103,7 @@ INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Wo INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Deploy List|List', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Deploy List|Scale', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Deploy List|Yaml', false, null); +INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Configuration', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Services|Topology', false, null); INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Services|Structure', false, null); @@ -158,10 +160,10 @@ INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('userGro --INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('user|admin|owner', false, 'DEFAULT_TENANT'); -INSERT INTO public.cloud_user (user_id, email, is_admin, phone, user_nm, user_pw, created_date, modified_date, company, department, last_log_in_date, "position", use_ldap, auth_method, log_in_count, user_lock, user_lock_date, tenant_id, is_tenant_owner, auth_resource_id) VALUES ('admin', NULL, true, NULL, 'admin', '$2a$10$a0XPdet9RCL8uF8ZVZ2Yzu4y0po5RWCesyB0e03MhrTIfG.0Y6xfS',now() , now() , NULL , NULL , NULL , NULL, false, 'default', 0, false, null, 'DEFAULT_TENANT', true, (select id from auth_resource3 where name='user|admin')); +INSERT INTO public.cloud_user (user_id, email, is_admin, phone, user_nm, user_pw, created_date, modified_date, company, department, last_log_in_date, "position", use_ldap, auth_method, log_in_count, user_lock, user_lock_date, tenant_id, is_tenant_owner, auth_resource_id) VALUES ('admin', NULL, true, NULL, 'admin', '$2a$10$iVk0h.S3eol7zI0VU7QFi.ovwVSIN4GbGaeTsvEPOmItSMVal2SoC',now() , now() , NULL , NULL , NULL , NULL, false, 'default', 0, false, null, 'DEFAULT_TENANT', true, (select id from auth_resource3 where name='user|admin')); INSERT INTO public.cloud_group (id, created_date, modified_date, name, description) VALUES ((select id from auth_resource3 where name='userGroup|admin|default'), now(), now(), 'default', '기본그룹정의'); ---INSERT INTO public.cloud_user (user_id, email, is_admin, phone, user_nm, user_pw, created_date, modified_date, company, department, last_log_in_date, "position", use_ldap, auth_method, log_in_count, user_lock, user_lock_date, tenant_id, is_tenant_owner, auth_resource_id) VALUES ('owner', NULL, false, NULL, 'owner', '$2a$10$a0XPdet9RCL8uF8ZVZ2Yzu4y0po5RWCesyB0e03MhrTIfG.0Y6xfS',now() , now() , NULL , NULL , NULL , NULL, false, 'default', 0, false, null, 'DEFAULT_TENANT', true, (select id from auth_resource3 where name='user|admin|owner')); +--INSERT INTO public.cloud_user (user_id, email, is_admin, phone, user_nm, user_pw, created_date, modified_date, company, department, last_log_in_date, "position", use_ldap, auth_method, log_in_count, user_lock, user_lock_date, tenant_id, is_tenant_owner, auth_resource_id) VALUES ('owner', NULL, false, NULL, 'owner', '$2a$10$iVk0h.S3eol7zI0VU7QFi.ovwVSIN4GbGaeTsvEPOmItSMVal2SoC',now() , now() , NULL , NULL , NULL , NULL, false, 'default', 0, false, null, 'DEFAULT_TENANT', true, (select id from auth_resource3 where name='user|admin|owner')); INSERT INTO public.cloud_user_setting (user_id, lang, theme, access_token, refresh_token, error_msg, alert_sound, session_persistence, gpu_acc_topology, created_date, modified_date) @@ -200,6 +202,7 @@ INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resou INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (17, 'Jobs', NULL, 6, 'jobsWorkloads', (select id from auth_resource3 where name='menu|Workloads|Jobs'), 2); -- INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (18, 'Cron Jobs', NULL, 7, 'cronJobsWorkloads', (select id from auth_resource3 where name='menu|Workloads|Cron Jobs'), 2); INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (19, 'Pods', NULL, 8, 'podsWorkloads', (select id from auth_resource3 where name='menu|Workloads|Pods'), 3); +INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (16, 'Pods', NULL, 9, 'configurationWorkloads', (select id from auth_resource3 where name='menu|Workloads|Configuration'), 3); INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (20, 'Services', '03.Service', 2, NULL, (select id from auth_resource3 where name='menu|Services'), 3); INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (21, 'DataCenter Service', NULL, 0, 'topologyServices', (select id from auth_resource3 where name='menu|Services|Topology'), 2); @@ -786,7 +789,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 ('node_filesystem_usage_per_device','Node Filesystem Usage per device (%)','NODE Filesystem Usage per Device','(1- (sum by (xm_clst_id, xm_node_id, xm_entity_type, device, mountpoint) (node_filesystem_avail_bytes{xm_entity_type=''Node'', device!=''rootfs'', {filter} }) / sum by (xm_clst_id, xm_node_id, xm_entity_type, device, mountpoint) (node_filesystem_size_bytes{xm_entity_type=''Node'', device!=''rootfs'', {filter} }))) * 100','Filesystem','Node',NULL,true,true,'NODE:{{$labels.xm_node_id}} FS:{{$labels.mountpoint}} Usage:{{humanize $value}}%|{threshold}%.','2019-05-15 01:02:23.000','2019-05-15 01:02:23.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_usage','Node Memory Usage (%)','Node Memory Usage','sum by (xm_clst_id, xm_node_id)((node_memory_MemTotal_bytes{xm_entity_type="Node"}- (node_memory_MemFree_bytes{xm_entity_type="Node"} + node_memory_Cached_bytes{xm_entity_type="Node"} + node_memory_Buffers_bytes{xm_entity_type="Node"})) >= 0 or node_memory_MemTotal_bytes{xm_entity_type="Node"}- node_memory_MemFree_bytes{xm_entity_type="Node"}) / (sum by (xm_clst_id, xm_node_id) (imxc_kubernetes_node_resource_capacity_memory{{filter}})) * 100','Memory','Node',NULL,true,true,'NODE:{{$labels.xm_node_id}} Memory Usage:{{humanize $value}}%|{threshold}%.','2019-05-15 01:02:23.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 ('oracledb_tablespace_size','Tablespace Size (GiB)','Generic counter metric of tablespaces bytes in Oracle','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, tablespace, type) (oracledb_tablespace_bytes) / 1073741824','Tablespace','OracleDB','tablespace, type',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Tablespace Size:{{humanize $value}}GiB|{threshold}GiB.','2020-01-28 13:03:00.000','2020-01-28 13:03: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_allocator_allocated_size','Allocated Memory (MiB)','The total amount of memory that the Redis allocator allocated','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_allocated_bytes) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Allocated Memory:{{humanize $value}}MiB|{threshold}MiB.','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_allocator_allocated_size','Allocated Memory (MiB)','The total amount of memory that the Redis allocator allocated','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_allocated_bytes{{filter}}) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Allocated Memory:{{humanize $value}}MiB|{threshold}MiB.','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 ('cluster_kubernetes_event_count','Cluster events count','Kubernetes Namespace Events count','sum by (xm_clst_id, type) (imxc_kubernetes_event_in_last_min{{filter}})','Event','Cluster',NULL,true,true,'CLST:{{$labels.xm_clst_id}} Event Count:{{humanize $value}}|{threshold}.','2019-09-26 05:33:37.000','2020-04-27 05:38:47.804'); 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 ('cluster_memory_limit','cluster_memory_limit (Gib)','Total container limit size in GiB for the given cluster','sum by (xm_clst_id) (imxc_kubernetes_container_resource_limit_memory{{filter}}) / 1024 / 1024 / 1024','Memory','Cluster',NULL,false,false,'CLST:{{$labels.xm_clst_id}} Memory Limits:{{humanize $value}}GiB|{threshold}GiB.','2019-08-23 08:45:47.000','2019-08-23 08:45:47.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 ('cluster_pod_total_count','Cluster Pod Total Count','Cluster Pod Total Count','sum by (xm_clst_id) (imxc_kubernetes_controller_counts{{filter}})','Pod','Cluster',NULL,true,true,'CLST:{{$labels.xm_clst_id}} Total Pod Counts:{{humanize $value}}|{threshold}.','2019-08-23 17:36:00.000','2019-11-28 08:25:07.000'); @@ -860,7 +863,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 ('namespace_memory_usage','Namespace memory usage (Gib)','Memory usage by namespace in bytes / 1073741824','sum by (xm_clst_id,xm_entity_type,xm_namespace) (container_memory_usage_bytes{xm_entity_type=''Container'', {filter}}) / 1073741824','Memory','Namespace',NULL,true,false,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Memory Utillization:{{humanize $value}}GiB|{threshold}GiB.','2019-08-23 01:21:31.000','2019-08-23 01:21:31.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_free','Node Memory Free (GiB)','Memory information field MemFree_bytes / 1073741824','node_memory_MemFree_bytes{xm_entity_type=''Node'', {filter}} / 1073741824','Memory','Node',NULL,true,true,'NODE:{{$labels.xm_node_id}} Free Memory Size:{{humanize $value}}GiB|{threshold}GiB.','2019-06-04 16:03:00.000','2019-06-04 16:03: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 ('node_swap_memory_cached','Node Swap Memory Cached (GiB)','Memory information field SwapCached_bytes / 1073741824','node_memory_SwapCached_bytes{xm_entity_type=''Node'', {filter}} / 1073741824','Memory','Node',NULL,true,true,'NODE:{{$labels.xm_node_id}} Cached Swap Memory Size:{{humanize $value}}GiB|{threshold}GiB.','2019-06-04 16:03:00.000','2019-06-04 16:03: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_allocator_active_size','Active Memory (MiB)','The total amount of active memory that the Redis allocator has','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_active_bytes) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Active Memory:{{humanize $value}}MiB|{threshold}MiB.','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_allocator_active_size','Active Memory (MiB)','The total amount of active memory that the Redis allocator has','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_active_bytes{{filter}}) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Active Memory:{{humanize $value}}MiB|{threshold}MiB.','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 ('mysql_up','MySQL Up Count','Whether the last scrape of metrics from MySQL was able to connect to the server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (mysql_up)','Instance','MySQL',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} MySQL Up counts:{{humanize $value}}|{threshold}.','2019-12-04 16:45:00.000','2019-12-04 16:45: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 ('oracledb_up','Oracle DB Up Count','Whether the Oracle database server is up','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (oracledb_up)','Instance','OracleDB',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle DB Up Count:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-01-28 13:03: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 ('oracledb_process_count','Process Count','Gauge metric with count of processes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (oracledb_process_count)','Process','OracleDB',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Process Count Count:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-01-28 13:03:00.000'); @@ -996,23 +999,23 @@ 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_wait_time_system_io','Wait-Time - System I/O','Generic counter metric from v$waitclassmetric view in Oracle','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(oracledb_wait_time_system_io[1m]))','Wait','OracleDB',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Wait-Time - System I/O:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-01-28 13:03: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 ('oracledb_wait_time_user_io','Wait-Time - User I/O','Generic counter metric from v$waitclassmetric view in Oracle','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(oracledb_wait_time_user_io[1m]))','Wait','OracleDB',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Wait-Time - User I/O:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-01-28 13:03: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 ('oracledb_wait_time_network','Wait-Time - Network','Generic counter metric from v$waitclassmetric view in Oracle','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(oracledb_wait_time_network[1m]))','Wait','OracleDB',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Oracle Wait-Time - Network:{{humanize $value}}|{threshold}.','2020-01-28 13:03:00.000','2020-01-28 13:03: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_blocked_clients','Blocked Clients','Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH)','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_blocked_clients)','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Blocked Clients:{{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_connected_clients','Connected Clients','Number of client connections (excluding connections from replicas)','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_clients)','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Connected Clients:{{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_connections_received','Received Connections','Total number of connections accepted by the server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_connections_received_total[1m]))','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Received Connections:{{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_rejected_connections','Rejected Connections','Number of connections rejected because of maxclients limit','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_rejected_connections_total[1m]))','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Rejected Connections:{{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_up','Redis Up Count','Whether the Redis server is up','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_up)','Instance','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Up Count:{{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_commands_total','Call Count / Command','Total number of calls per command','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_total[1m]))','Request','Redis','cmd',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Call Count:{{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_commands_processed','Processed Commands','Total number of commands processed by the server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_commands_processed_total[1m]))','Request','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace:}} Redis Processed Commands:{{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_blocked_clients','Blocked Clients','Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH)','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_blocked_clients{{filter}})','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Blocked Clients:{{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_connected_clients','Connected Clients','Number of client connections (excluding connections from replicas)','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_clients{{filter}})','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Connected Clients:{{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_connections_received','Received Connections','Total number of connections accepted by the server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_connections_received_total{{filter}}[5m]))','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Received Connections:{{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_rejected_connections','Rejected Connections','Number of connections rejected because of maxclients limit','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_rejected_connections_total{{filter}}[5m]))','Connection','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Rejected Connections:{{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_up','Redis Up Count','Whether the Redis server is up','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_up{{filter}})','Instance','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Up Count:{{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_commands_total','Call Count / Command','Total number of calls per command','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_total{{filter}}[5m]))','Request','Redis','cmd',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Call Count:{{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_commands_processed','Processed Commands','Total number of commands processed by the server','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_commands_processed_total{{filter}}[5m]))','Request','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace:}} Redis Processed Commands:{{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_key_hit_raito','Redis key hit raito','redis key hit raito','sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( -label_replace(rate(redis_keyspace_hits_total [1m]), "data_type", "hits", "" , "") or -label_replace(rate(redis_keyspace_misses_total [1m]), "data_type", "misses", "" , "") )','Keyspace','Redis','data_type',true,false,'redis key hit raito','2020-01-29 02:28:03.000','2020-02-13 00:46:27.568'); +label_replace(rate(redis_keyspace_hits_total{{filter}} [5m]), "data_type", "hits", "" , "") or +label_replace(rate(redis_keyspace_misses_total{{filter}} [5m]), "data_type", "misses", "" , "") )','Keyspace','Redis','data_type',true,false,'redis key hit raito','2020-01-29 02:28:03.000','2020-02-13 00:46:27.568'); -- CLOUD-16405 Metric Meta | 대시보드 관련 메트릭 수정 -- REDIS Slave 관련 메트릭 추가 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_connected_slave_lag_seconds','Redis Connected Slave Lag Seconds','Redis Connected Slave Lag Seconds','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_lag_seconds[1m]))','Worker','Redis',NULL,true,true,'Redis Connected Slave Lag Seconds','2023-03-16 14:39:57.420','2023-03-16 14:39:57.420'), - ('redis_connected_slave_offset_bytes','Redis Connected Slave Offset Bytes','Redis Connected Slave Offset Bytes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_offset_bytes[1m]))','Worker','Redis',NULL,true,true,'Redis Connected Slave Offset Bytes','2023-03-16 14:37:43.734','2023-03-16 14:38:22.164'), - ('redis_connected_slaves','Redis Connected Slaves','Redis Connected Slaves','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_slaves)','Worker','Redis',NULL,true,true,'Redis Connected Slaves','2023-03-16 13:57:09.423','2023-03-16 13:59:50.746'); + ('redis_connected_slave_lag_seconds','Redis Connected Slave Lag Seconds','Redis Connected Slave Lag Seconds','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_lag_seconds{{filter}}[5m]))','Worker','Redis',NULL,true,true,'Redis Connected Slave Lag Seconds','2023-03-16 14:39:57.420','2023-03-16 14:39:57.420'), + ('redis_connected_slave_offset_bytes','Redis Connected Slave Offset Bytes','Redis Connected Slave Offset Bytes','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_offset_bytes{{filter}}[5m]))','Worker','Redis',NULL,true,true,'Redis Connected Slave Offset Bytes','2023-03-16 14:37:43.734','2023-03-16 14:38:22.164'), + ('redis_connected_slaves','Redis Connected Slaves','Redis Connected Slaves','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_slaves{{filter}})','Worker','Redis',NULL,true,true,'Redis Connected Slaves','2023-03-16 13:57:09.423','2023-03-16 13:59:50.746'); 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_net_byte_total','Network byte','Network byte','sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( label_replace(rate(redis_net_input_bytes_total [1m]), "data_type", "input", "", "") or @@ -1035,30 +1038,30 @@ 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_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'); +label_replace(rate(redis_cpu_sys_seconds_total{{filter}}[5m]), "data_type", "system", "", "") or +label_replace(rate(redis_cpu_user_seconds_total{{filter}}[5m]), "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_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'); -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_expired_keys','Expired Keys','Total number of key expiration events','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_expired_keys_total[1m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Expired Keys:{{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_evicted_keys','Evicted Keys','Number of evicted keys due to maxmemory limit','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_evicted_keys_total[1m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Evicted Keys:{{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_expiring','DB Keys Count Expiring','Total number of expiring keys by DB','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys_expiring)','Keyspace','Redis','db',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis DB Keys Count Expiring:{{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_commands_duration_seconds','Duration Seconds / Command','Total duration seconds per command','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_duration_seconds_total[1m]) * 1000)','Request','Redis','cmd',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Duration Seconds:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-29 01:42:36.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{{filter}}[5m]))','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{{filter}}[5m]))','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{{filter}}[5m]))','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{{filter}})','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'); +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_expired_keys','Expired Keys','Total number of key expiration events','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_expired_keys_total{{filter}}[5m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Expired Keys:{{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_evicted_keys','Evicted Keys','Number of evicted keys due to maxmemory limit','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_evicted_keys_total{{filter}}[5m]))','Keyspace','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Evicted Keys:{{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_expiring','DB Keys Count Expiring','Total number of expiring keys by DB','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys_expiring{{filter}})','Keyspace','Redis','db',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis DB Keys Count Expiring:{{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_commands_duration_seconds','Duration Seconds / Command','Total duration seconds per command','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_duration_seconds_total{{filter}}[5m]) * 1000)','Request','Redis','cmd',true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Duration Seconds:{{humanize $value}}|{threshold}.','2020-01-28 14:33:00.000','2020-01-29 01:42:36.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_memory_total','Redis memory total','redis memory total','sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( -label_replace(redis_allocator_active_bytes / 1048576, "data_type", "active", "" , "") or -label_replace(redis_memory_used_bytes / 1048576, "data_type", "used", "" , "") or -label_replace(redis_allocator_allocated_bytes / 1048576, "data_type", "allocated", "" , "") or -label_replace(redis_allocator_resident_bytes / 1048576, "data_type", "resident", "" , "") )','Memory','Redis','data_type',true,false,'redis memory total','2020-01-29 02:08:28.000','2020-02-13 00:45:28.475'); +label_replace(redis_allocator_active_bytes{{filter}} / 1048576, "data_type", "active", "" , "") or +label_replace(redis_memory_used_bytes{{filter}} / 1048576, "data_type", "used", "" , "") or +label_replace(redis_allocator_allocated_bytes{{filter}} / 1048576, "data_type", "allocated", "" , "") or +label_replace(redis_allocator_resident_bytes{{filter}} / 1048576, "data_type", "resident", "" , "") )','Memory','Redis','data_type',true,false,'redis memory total','2020-01-29 02:08:28.000','2020-02-13 00:45:28.475'); 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 ('count_by_connection_type','Count by connection type','count by connection type','sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( -label_replace(rate(redis_connections_received_total [1m]), "data_type", "received connections", "", "") or -label_replace(rate(redis_rejected_connections_total [1m]), "data_type", "rejected connections", "", "") or -label_replace(redis_connected_clients, "data_type", "connected clients", "", "") or -label_replace(redis_blocked_clients, "data_type", "blocked clients", "", "") )','Connection','Redis','data_type',true,false,'count by connection type','2020-01-29 00:49:09.000','2020-02-13 01:04:18.528'); +label_replace(rate(redis_connections_received_total{{filter}} [5m]), "data_type", "received connections", "", "") or +label_replace(rate(redis_rejected_connections_total{{filter}} [5m]), "data_type", "rejected connections", "", "") or +label_replace(redis_connected_clients{{filter}}, "data_type", "connected clients", "", "") or +label_replace(redis_blocked_clients{{filter}}, "data_type", "blocked clients", "", "") )','Connection','Redis','data_type',true,false,'count by connection type','2020-01-29 00:49:09.000','2020-02-13 01:04:18.528'); 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_tup_count','Number of row by stat','Number of row by stat','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, data_type) (label_replace(rate(pg_stat_database_tup_deleted[1m]), "data_type", "deleted", "", "") or label_replace(rate(pg_stat_database_tup_updated[1m]), "data_type", "updated", "", "") or @@ -1068,8 +1071,8 @@ label_replace(rate(pg_stat_database_tup_fetched[1m]), "data_type", "fetched", "" 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_blk_read_write_time','Read/Write spent time by file blocks','Read/Write spent time by file blocks','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, data_type) (label_replace(rate(pg_stat_database_blk_read_time [1m]), "data_type", "read", "", "") or label_replace(rate(pg_stat_database_blk_write_time [1m]), "data_type", "write", "", ""))','Block','PostgreSQL','data_type',true,false,'Read/Write spent time by file blocks','2019-10-28 10:56:48.000','2020-02-13 01:06:46.680'); -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_allocator_resident_size','Resident Memory (MiB)','The total amount of resident memory that the Redis allocator has','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_resident_bytes) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Resident Memory:{{humanize $value}}MiB|{threshold}MiB.','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_memory_used_size','Used Memory (MiB)','Total number of bytes allocated by Redis using its allocator','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_memory_used_bytes) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Used Memory:{{humanize $value}}MiB|{threshold}MiB.','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_allocator_resident_size','Resident Memory (MiB)','The total amount of resident memory that the Redis allocator has','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_resident_bytes{{filter}}) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Resident Memory:{{humanize $value}}MiB|{threshold}MiB.','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_memory_used_size','Used Memory (MiB)','Total number of bytes allocated by Redis using its allocator','sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_memory_used_bytes{{filter}}) / 1048576','Memory','Redis',NULL,true,true,'CLST:{{$labels.xm_clst_id}} NS:{{$labels.xm_namespace}} Redis Used Memory:{{humanize $value}}MiB|{threshold}MiB.','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 ('cassandra_clientrequest_anormal_count','Number of anormal request','Number of anormal request ','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, anormal_type) (label_replace(rate(cassandra_clientrequest_unavailables_count[1m]), "anormal_type", "unavailables", "", "") or label_replace(rate(cassandra_clientrequest_timeouts_count[1m]), "anormal_type", "timeouts", "", "") or @@ -1164,7 +1167,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) (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 ('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_cpu_user_seconds_total{{filter}}[5m]))','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 +1227,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_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 ('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{{filter}}[5m]))','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{{filter}}[5m]))','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'); @@ -1560,6 +1563,119 @@ spec: volumeMounts: - name: tmp-dir mountPath: /tmp1', true, '2021-03-11 13:41:48.000000', '2021-03-11 13:41:56.000000'); + +insert into public.agent_install_file_info (id, name, type, description, version, yaml, use_yn, created_date, modified_date) values (8, 'otel-trace', 'agent', 'CloudMOA에서는 고객사에서 운영 중인 application의 TPS, 서비스 연관관계 등의 데이터를 얻기 위해서 Opentelemetry를 사용하며, Opentelemetry 사용을 위해 애플리케이션의 instrumentation이 필요합니다. +' null, '--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + selector: + matchLabels: + app: otel-trace-agent + template: + metadata: + labels: + app: otel-trace-agent + spec: + containers: + - image: $DOCKER_REGISTRY_URL/otel-trace-agent:$IMAGE_TAG + imagePullPolicy: Always + name: otel-trace-agent + resources: + requests: + cpu: 100m + memory: 50Mi + limits: + cpu: 200m + memory: 100Mi + ports: + - containerPort: 4317 + protocol: TCP + env: + - name: CMOA_LOG_LEVEL + value: "INFO" + - name: CMOA_CLUSTER_ID + value: $CLOUDMOA_CLUSTER_ID + - name: CMOA_DATAGATE + value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT + volumeMounts: + - name: config + mountPath: /CloudMOA/default_config.yaml + subPath: default_config.yaml + volumes: + - name: config + configMap: + name: otel-trace-agent-config + items: + - key: config.yaml + path: default_config.yaml + +--- + +apiVersion: v1 +kind: Service +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + ports: + - name: otel-port + port: 4317 + protocol: TCP + targetPort: 4317 + selector: + app: otel-trace-agent + type: ClusterIP + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: otel-trace-agent-config + namespace: $CLOUDMOA_NAMESPACE +data: + config.yaml: | + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + processors: + batch: + probabilistic_sampler: + hash_seed: 22 + sampling_percentage: 100 + exporters: + # cmoaexporter 설정 + cmoaexporter: + api: + endpoint: "127.0.0.1:7070" + traces: + endpoint: "127.0.0.1:7070" + tls: + enable: false + skip_host_verify: true + ca_file: "" + cert_file: "" + key_file: "" + queue: + enabled: true + service: + pipelines: + traces: + receivers: [otlp] + processors: [batch, probabilistic_sampler] + exporters: [cmoaexporter] +'); + insert into public.agent_install_file_info (id, name, type, description, version, yaml, use_yn, created_date, modified_date) values (7, 'jaeger', 'application', 'CloudMOA에서는 고객사에서 운영 중인 application의 TPS, 서비스 연관관계 등의 데이터를 얻기 위해서 Jaeger를 사용하며, Jaeger 사용을 위해 Jaeger-client, jaeger-agent, jaeger-collector의 설치가 필요합니다. ', null, '--- apiVersion: v1 @@ -1942,6 +2058,12 @@ spec: fieldPath: metadata.namespace - name: LOG_LEVEL value: "INFO" + livenessProbe: + httpGet: + path: /healthz + port: 18081 + initialDelaySeconds: 30 + timeoutSeconds: 5 volumes: - name: bin-volume hostPath: @@ -2484,3 +2606,21 @@ INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,ent -- 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}%.'); + +-- log parsing 관련 metric meta 추가 log parsing 관련 metric_id는 ** id = log_parsing 필수 들어 가함 front에서 parsing해서 씀 ( rel0.0.0에 적용 해야함 ) +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) VALUES ('count_pod_log_parsing','Log Parsing Log of Pods By Workload','Log Parsing Log of Pods By Workload','count by (xm_clst_id, xm_node_id, xm_namespace, xm_pod_id, xm_regex) (log_metric_counter_cmoa_metric{{filter}})','Log','Workload','xm_clst_id, xm_namespace, xm_pod_id',true,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}} regex:{{$labels.xm_regex}}.'); + +-- CLOUD-20838 | Alert | topology-agent / node-agent 다운 시 alert 생성 +-- Auto-generated SQL script #202310101523 +-- TODO: node 레벨로 설정하지 않고, cluster 단위로 alert을 설정할 수 있도록 개선할 수 있음 +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,in_use,message) + VALUES ('agent_node_ready','Agent Node Ready','Used to verify that the node agent is sending data normally','clamp_max(count(node_boot_time_seconds{})by(xm_clst_id),1)','Agent','Node',true,'Node data is not being collected on Cluster CLST:{{$labels.xm_clst_id}}. Is the cloudmoa-node-agent healthy?'); +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,in_use,message) + VALUES ('agent_topology_ready','Agent Topology Ready','Used to verify that the topology agent is sending data normally','clamp_max(count(imxc_kubernetes_node_ready{})by(xm_clst_id),1)','Agent','Node',true,'Topology data is not being collected on Cluster CLST:{{$labels.xm_clst_id}}. Is the cloudmoa-topology-agent healthy?'); + +-- Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_oomkilled','OOMKilled of Pods By Workload','OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id',TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); +-- Last Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_last_oomkilled','Last OOMKilled of Pods By Workload','Last OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_last_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id', TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); diff --git a/roles/cmoa_install/files/05-imxc/templates/auth-server.yaml b/roles/cmoa_install/files/05-imxc/templates/auth-server.yaml index bb15527..5dff000 100755 --- a/roles/cmoa_install/files/05-imxc/templates/auth-server.yaml +++ b/roles/cmoa_install/files/05-imxc/templates/auth-server.yaml @@ -63,6 +63,8 @@ spec: # 현대카드는 커스텀으로 해당 값 추가. keycloak만 사용(true), keycloak+내부db 사용(false) - name: IMXC_KEYCLOAK_ENABLED value: "true" + - name: IMXC_KEYCLOAK_MASTER_PASSWORD + value: admin volumeMounts: - name: init diff --git a/roles/cmoa_install/files/values/imxc.j2 b/roles/cmoa_install/files/values/imxc.j2 index d0233c8..fd3afcf 100644 --- a/roles/cmoa_install/files/values/imxc.j2 +++ b/roles/cmoa_install/files/values/imxc.j2 @@ -86,7 +86,7 @@ global: KEYCLOAK_AUTH_SERVER_URL: http://111.111.111.111:31082/auth KEYCLOAK_RESOURCE: authorization_server KEYCLOAK_MASTER_USERNAME: admin - KEYCLOAK_MASTER_PASSWORD: "admin" + KEYCLOAK_MASTER_PASSWORD: admin IMXC_PORTAL_INFO_URL: KEYCLOAK_REALM: exem # added by EunHye Kim 2021-08-25 diff --git a/roles/cmoa_pgpatch/defaults/main.yml b/roles/cmoa_pgpatch/defaults/main.yml index 337a57a..371e031 100644 --- a/roles/cmoa_pgpatch/defaults/main.yml +++ b/roles/cmoa_pgpatch/defaults/main.yml @@ -1,7 +1,4 @@ --- cmoa_namespace: imxc pg_version: - - 3.5.1 - - 3.5.2 - - 3.5.3 - - 3.5.4 + - 3.5.5 diff --git a/roles/cmoa_pgpatch/files/pg-patch/postgres_patch_3.5.5.psql b/roles/cmoa_pgpatch/files/pg-patch/postgres_patch_3.5.5.psql new file mode 100644 index 0000000..c185527 --- /dev/null +++ b/roles/cmoa_pgpatch/files/pg-patch/postgres_patch_3.5.5.psql @@ -0,0 +1,673 @@ +-- CLOUD-20862 | Topology Agent | 리더 선출 로직 개선 +-- Auto-generated SQL script #202310121749 +UPDATE public.agent_install_file_info + SET yaml='--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cloudmoa-cluster-role +rules: + - nonResourceURLs: + - "*" + verbs: + - get + - apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - pods + verbs: + - get + - list + - watch + - update + - apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch + - update + - apiGroups: + - "" + resources: + - nodes/stats + - endpoints + - namespaces + - events + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - daemonsets + - deployments + - deployments/scale + - replicasets + - replicasets/scale + - statefulsets + - statefulsets/scale + verbs: + - get + - list + - watch + - update + - apiGroups: + - batch + resources: + - jobs + verbs: + - get + - list + - watch + - update + - apiGroups: + - batch + resources: + - cronjobs + verbs: + - get + - list + - update + - apiGroups: + - storage.j8s.io + resources: + - storageclasses + verbs: + - get + - list + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - apiGroups: + - extensions + resources: + - ingresses + verbs: + - get + - list + - apiGroups: + - policy + resources: + - podsecuritypolicies + verbs: + - use + resourceNames: + - imxc-ps + - apiGroups: + - certificates.k8s.io + resourceNames: + - kubernetes.io/kube-apiserver-client-kubelet + resources: + - signers + verbs: + - approve + - apiGroups: + - certificates.k8s.io + resourceNames: + - kubernetes.io/kubelet-serving + resources: + - signers + verbs: + - approve + - apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch + - proxy + - apiGroups: + - "" + resources: + - nodes/log + - nodes/metrics + - nodes/proxy + - nodes/spec + - nodes/stats + verbs: + - ''*'' + - apiGroups: + - ''*'' + resources: + - ''*'' + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cloudmoa-restricted-rb + namespace: $CLOUDMOA_NAMESPACE +subjects: + - kind: ServiceAccount + name: default + namespace: $CLOUDMOA_NAMESPACE +roleRef: + kind: ClusterRole + name: cloudmoa-cluster-role + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: cloudmoa-psp + namespace: $CLOUDMOA_NAMESPACE +spec: + privileged: true + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + runAsUser: + rule: RunAsAny + fsGroup: + rule: RunAsAny + hostPorts: + - max: 65535 + min: 0 + hostNetwork: true + hostPID: true + volumes: + - configMap + - secret + - emptyDir + - hostPath + - projected + - downwardAPI + - persistentVolumeClaim +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: cloudmoa-topology-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: cloudmoa-topology-agent +spec: + selector: + matchLabels: + app: cloudmoa-topology-agent + template: + metadata: + labels: + app: cloudmoa-topology-agent + spec: + hostNetwork: true + hostPID: true + tolerations: + - effect: NoSchedule + operator: Exists + - effect: NoExecute + operator: Exists + containers: + - image: $DOCKER_REGISTRY_URL/node-exporter + name: node-agent + resources: + limits: + cpu: 250m + memory: 180Mi + requests: + cpu: 125m + memory: 90Mi + ports: + - containerPort: 9110 + hostPort: 9110 + name: scrape + args: + - --path.procfs=/host/proc + - --path.sysfs=/host/sys + - --path.rootfs=/host/root + - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) + - --collector.tcpstat + - --web.listen-address=:9110 + # --log.level=debug + env: + - name: GOMAXPROCS + value: "1" + volumeMounts: + - mountPath: /host/proc + name: proc-volume + readOnly: false + - mountPath: /host/sys + name: sys-volume + readOnly: false + - mountPath: /host/root + mountPropagation: HostToContainer + name: root-volume + readOnly: true + - name: cloudmoa-topology-agent + image: $DOCKER_REGISTRY_URL/topology-agent:$IMAGE_TAG + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 500m + memory: 600Mi + securityContext: + privileged: true + volumeMounts: + - mountPath: /host/usr/bin + name: bin-volume + - mountPath: /var/run/docker.sock + name: docker-volume + - mountPath: /host/proc + name: proc-volume + - mountPath: /root + name: root-volume + - mountPath: /log + name: log-volume + env: + - name: DATAGATE + value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT + - name: CLUSTER_ID + value: $CLOUDMOA_CLUSTER_ID + - name: ROOT_DIRECTORY + value: /root + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: POD_ID + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: LOG_LEVEL + value: "INFO" + livenessProbe: + httpGet: + path: /healthz + port: 18081 + initialDelaySeconds: 30 + timeoutSeconds: 5 + volumes: + - name: bin-volume + hostPath: + path: /usr/bin + type: Directory + - name: docker-volume + hostPath: + path: /var/run/docker.sock + - name: proc-volume + hostPath: + path: /proc + - name: root-volume + hostPath: + path: / + - hostPath: + path: /sys + name: sys-volume + - name: log-volume + hostPath: + path: /home' + WHERE id=2; + +-- CLOUD-18687 otel-trace agent 추가 +INSERT INTO public.agent_install_file_info (id, name, type, description, version, yaml, use_yn, created_date, + modified_date) +VALUES (8, 'otel-trace', 'agent', + 'CloudMOA에서는 고객사에서 운영 중인 application의 TPS, 서비스 연관관계 등의 데이터를 얻기 위해서 Opentelemetry를 사용하며, Opentelemetry 사용을 위해 애플리케이션의 instrumentation이 필요합니다.', + null, '--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + selector: + matchLabels: + app: otel-trace-agent + template: + metadata: + labels: + app: otel-trace-agent + spec: + containers: + - image: $DOCKER_REGISTRY_URL/otel-trace-agent:$IMAGE_TAG + imagePullPolicy: Always + name: otel-trace-agent + resources: + requests: + cpu: 100m + memory: 50Mi + limits: + cpu: 200m + memory: 100Mi + ports: + - containerPort: 4317 + protocol: TCP + env: + - name: CMOA_LOG_LEVEL + value: "INFO" + - name: CMOA_CLUSTER_ID + value: $CLOUDMOA_CLUSTER_ID + - name: CMOA_DATAGATE + value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT + volumeMounts: + - name: config + mountPath: /CloudMOA/default_config.yaml + subPath: default_config.yaml + volumes: + - name: config + configMap: + name: otel-trace-agent-config + items: + - key: config.yaml + path: default_config.yaml + +--- + +apiVersion: v1 +kind: Service +metadata: + name: otel-trace-agent + namespace: $CLOUDMOA_NAMESPACE + labels: + app: otel-trace-agent +spec: + ports: + - name: otel-port + port: 4317 + protocol: TCP + targetPort: 4317 + selector: + app: otel-trace-agent + type: ClusterIP + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: otel-trace-agent-config + namespace: $CLOUDMOA_NAMESPACE +data: + config.yaml: | + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + processors: + batch: + probabilistic_sampler: + hash_seed: 22 + sampling_percentage: 100 + exporters: + # cmoaexporter 설정 + cmoaexporter: + api: + endpoint: "127.0.0.1:7070" + traces: + endpoint: "127.0.0.1:7070" + tls: + enable: false + skip_host_verify: true + ca_file: "" + cert_file: "" + key_file: "" + queue: + enabled: true + service: + pipelines: + traces: + receivers: [otlp] + processors: [batch, probabilistic_sampler] + exporters: [cmoaexporter]'); + +-- CLOUD-21306 | Redis Metric Meta 패치 +-- Auto-generated SQL script #202310171617 +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_misses_total{{filter}}[5m]))' + WHERE id='redis_keyspace_misses'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_keyspace_hits_total{{filter}}[5m]))' + WHERE id='redis_keyspace_hits'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_connections_received_total{{filter}}[5m]))' + WHERE id='redis_connections_received'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_children_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_sys_children'; +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{{filter}}[5m]), "data_type", "system", "", "") or +label_replace(rate(redis_cpu_user_seconds_total{{filter}}[5m]), "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_user_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_user'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_slaves{{filter}})' + WHERE id='redis_connected_slaves'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_total{{filter}}[5m]))' + WHERE id='redis_commands_total'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_memory_used_bytes{{filter}}) / 1048576' + WHERE id='redis_memory_used_size'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_resident_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_resident_size'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_sys_seconds_total{{filter}}[5m]))' + WHERE id='redis_used_cpu_sys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_cpu_user_children_seconds_total{{filter}} [5m]))' + WHERE id='redis_used_cpu_user_children'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_up{{filter}})' + WHERE id='redis_up'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_allocated_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_allocated_size'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(rate(redis_connections_received_total{{filter}} [5m]), "data_type", "received connections", "", "") or +label_replace(rate(redis_rejected_connections_total{{filter}} [5m]), "data_type", "rejected connections", "", "") or +label_replace(redis_connected_clients{{filter}}, "data_type", "connected clients", "", "") or +label_replace(redis_blocked_clients{{filter}}, "data_type", "blocked clients", "", "") )' + WHERE id='count_by_connection_type'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(redis_allocator_active_bytes{{filter}} / 1048576, "data_type", "active", "" , "") or +label_replace(redis_memory_used_bytes{{filter}} / 1048576, "data_type", "used", "" , "") or +label_replace(redis_allocator_allocated_bytes{{filter}} / 1048576, "data_type", "allocated", "" , "") or +label_replace(redis_allocator_resident_bytes{{filter}} / 1048576, "data_type", "resident", "" , "") )' + WHERE id='redis_memory_total'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, cmd) (rate(redis_commands_duration_seconds_total{{filter}}[5m]) * 1000)' + WHERE id='redis_commands_duration_seconds'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_rejected_connections_total{{filter}}[5m]))' + WHERE id='redis_rejected_connections'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_blocked_clients{{filter}})' + WHERE id='redis_blocked_clients'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_offset_bytes{{filter}}[5m]))' + WHERE id='redis_connected_slave_offset_bytes'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys_expiring{{filter}})' + WHERE id='redis_db_keys_expiring'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_evicted_keys_total{{filter}}[5m]))' + WHERE id='redis_evicted_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_connected_clients{{filter}})' + WHERE id='redis_connected_clients'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, slave_ip, slave_port) (rate(redis_connected_slave_lag_seconds{{filter}}[5m]))' + WHERE id='redis_connected_slave_lag_seconds'; +UPDATE public.metric_meta2 + SET expr='sum by (data_type, xm_clst_id, xm_namespace, xm_node_id, instance) ( +label_replace(rate(redis_keyspace_hits_total{{filter}} [5m]), "data_type", "hits", "" , "") or +label_replace(rate(redis_keyspace_misses_total{{filter}} [5m]), "data_type", "misses", "" , "") )' + WHERE id='redis_key_hit_raito'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_commands_processed_total{{filter}}[5m]))' + WHERE id='redis_commands_processed'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (rate(redis_expired_keys_total{{filter}}[5m]))' + WHERE id='redis_expired_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance, db) (redis_db_keys{{filter}})' + WHERE id='redis_db_keys'; +UPDATE public.metric_meta2 + SET expr='sum by (xm_clst_id, xm_namespace, xm_node_id, instance) (redis_allocator_active_bytes{{filter}}) / 1048576' + WHERE id='redis_allocator_active_size'; + +-- Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_oomkilled','OOMKilled of Pods By Workload','OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id',TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); +-- Last Reason OOMKilled +INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,message) +VALUES ('count_pod_last_oomkilled','Last OOMKilled of Pods By Workload','Last OOMKilled of Pods By Workload','count by (xm_clst_id, xm_pod_id, xm_cont_name, xm_namespace) (imxc_pod_container_status_last_terminated_reason_oom{{filter}})','State','Workload','xm_clst_id, xm_namespace, xm_pod_id', TRUE,'CLST:{{$labels.xm_clst_id}} POD:{{$labels.xm_pod_id}} NS:{{$labels.xm_namespace}}.'); + +-- Configuration Menu 추가 +INSERT INTO public.auth_resource2 (access_type, name, parent_id, type) VALUES (4, 'Configuration', (select id from auth_resource2 where type='menu' and name='Workloads'), 'menu'); +INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Workloads|Configuration', false, null); +INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (16, 'Pods', NULL, 9, 'configurationWorkloads', (select id from auth_resource3 where name='menu|Workloads|Configuration'), 3); + + +-- log parsing 관련 metric meta rate연산 삭제 +UPDATE metric_meta2 SET expr = 'count by (xm_clst_id, xm_node_id, xm_namespace, xm_pod_id, xm_regex) (log_metric_counter_cmoa_metric{{filter}})' WHERE id = 'count_pod_log_parsing'; + +CREATE TABLE "intermax" ( + "cluster_id" VARCHAR(128) NOT NULL, + "namespace" VARCHAR(128) NOT NULL, + "url" VARCHAR(256) NULL DEFAULT NULL, + "service_name" VARCHAR(128) NULL DEFAULT NULL, + PRIMARY KEY ("cluster_id", "namespace") +); + +-- Configuration Table 생성 + +CREATE TABLE "cmoa_storageclass_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "provisioner" TEXT NULL DEFAULT NULL, + "reclaimpolicy" TEXT NULL DEFAULT NULL, + "volumebindingmode" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_ingress_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "spec_rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrole_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_labels" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_clusterrolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_role_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "rules" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_rolebinding_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "subjects" TEXT NULL DEFAULT NULL, + "roleref" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); + +CREATE TABLE "cmoa_serviceaccount_base" ( + "kube_flatting_time" BIGINT NOT NULL, + "cluster_id" VARCHAR(255) NOT NULL, + "kind" VARCHAR(30) NOT NULL, + "metadata_uid" VARCHAR(40) NOT NULL, + "row_index" INTEGER NOT NULL, + "metadata_name" TEXT NULL DEFAULT NULL, + "metadata_creationtimestamp" VARCHAR(25) NULL DEFAULT NULL, + "metadata_resourceversion" TEXT NULL DEFAULT NULL, + "metadata_namespace" TEXT NULL DEFAULT NULL, + "secrets" TEXT NULL DEFAULT NULL, + PRIMARY KEY ("kube_flatting_time", "cluster_id", "kind", "metadata_uid", "row_index") +); +commit;