我想比较以下两个彼此不同的时间序列。我要做的就是将第二个时间序列的结果除以第一个时间序列的结果,如果值小于 1,则生成警报。我正在使用的查询低于我在下面提到的时间序列. 如何实现我的目标?
第一次系列:
container_memory_usage_bytes{container_name="documentation"}
结果:
container_memory_usage_bytes{
beta_kubernetes_io_arch="amd64",
beta_kubernetes_io_fluentd_ds_ready="true",
beta_kubernetes_io_instance_type="n1-highmem-8",
beta_kubernetes_io_os="linux",
cloud_google_com_gke_nodepool="pool-1",
container_name="documentation",
failure_domain_beta_kubernetes_io_region="europe-west1",
failure_domain_beta_kubernetes_io_zone="europe-west1-b",
id="/kubepods/burstable/podb79239ff-1ee9-11e8-a6c1-42010a840fd9/3ccdaa6597d5bd306d228e37d9d4c65a9681dba2e894aa7b7ed4502ec54e5619",
image="gcr.io/ingenious-169318/publicapi/documentation@sha256:60a5454bb40ed34f24cbeb9f330e1097191754cf2890eee1ca4f2988188a7705",
instance="gke-ingenious-pool-1-bbd77706-5rbz",
job="kubernetes-cadvisor",
kubernetes_io_hostname="gke-ingenious-pool-1-bbd77706-5rbz",
name="k8s_documentation_documentation-6c4c4c9f5f-dn2bv_apimanager_b79239ff-1ee9-11e8-a6c1-42010a840fd9_0",
namespace="apimanager",
pod_name="documentation-6c4c4c9f5f-dn2bv"
}
第二个时间序列:-
kube_pod_container_resource_requests_memory_bytes{container="documentation"}
结果:
kube_pod_container_resource_requests_memory_bytes{
container="documentation",
instance="10.32.0.30:8080",
job="kubernetes-service-endpoints",
k8s_app="kube-state-metrics",
kubernetes_name="kube-state-metrics",
kubernetes_namespace="kube-system",
namespace="apimanager",
node="gke-ingenious-pool-1-bbd77706-pdsz",
pod="documentation-6c4c4c9f5f-mzd54"
}
PromQL:
kube_pod_container_resource_requests_memory_bytes{container="documentation"} / (container_memory_usage_bytes{namespace="apimanager"})