Hello,
I’m trying to migrate to multi-dimensional alerts from classic alerts. I have reviewed all existing documentation and videos but still don’t know how to create them. There is only a theory available and very basic examples, without real life examples and tutorials. Its so frustrating and time wasting.
How can I rewrite following queries in order to be able to use multi-dimensional alerts?
Containers has restarted more than 10 times in the last 24 hours or more than 4 times in the last 30 minutes
"count(rate(container_start_time_seconds{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}[24h])) - sum(kube_deployment_spec_replicas{deployment=\"${{SERVICE_NAME}}\"})",
expr": "count(rate(container_start_time_seconds{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}[30m])) - sum(kube_deployment_spec_replicas{deployment=\"${{SERVICE_NAME}}\"})",
"The percentage of allocated CPU resources being used (where 100 % is the maximum) 5 minute rolling average",
"sum(rate(container_cpu_usage_seconds_total{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}[5m])) by (pod) /\nsum(container_spec_cpu_shares{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"} / container_spec_cpu_period{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}) by (pod)",
${{SERVICE_NAME}} Memory Usage went above 80% in the past 5min",
"sum(container_memory_working_set_bytes{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}) by (pod) / min(container_spec_memory_limit_bytes{job=\"kubernetes-nodes-cadvisor\", container=\"${{SERVICE_NAME}}\"}) by (pod)",
thanks in advance