Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job labels to monitoring alerts #1065

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/alerts/example-alert-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"rules": [
{
"alert": "Amd64 metric missing in cluster ci-dev-aks-mac-eus",
"expression": "absent(node_uname_info{machine=\"x86_64\"}) == 1 or node_uname_info{machine=\"x86_64\"} == 0",
"expression": "absent(node_uname_info{job=\"node\",machine=\"x86_64\"}) == 1 or node_uname_info{job=\"node\",machine=\"x86_64\"} == 0",
"for": "PT30M",
"annotations": {
"description": "Amd64 metric missing in cluster ci-dev-aks-mac-eus"
Expand Down Expand Up @@ -200,7 +200,7 @@
},
{
"alert": "CPU usage % greater than 75 for prometheus-collector containers on cluster ci-dev-aks-mac-eus",
"expression": "sum(sum by (cluster, namespace, pod, container) ( rate(container_cpu_usage_seconds_total{job=\"cadvisor\", image!=\"\", namespace=\"kube-system\", container=\"prometheus-collector\"}[5m]) ) * on (cluster, namespace, pod) group_left(node) topk by (cluster, namespace, pod) ( 1, max by(cluster, namespace, pod, node) (kube_pod_info{node!=\"\", namespace=\"kube-system\"}) )) by (container, pod) *100 > 75",
"expression": "sum(sum by (cluster, namespace, pod, container) ( rate(container_cpu_usage_seconds_total{job=\"cadvisor\", image!=\"\", namespace=\"kube-system\", container=\"prometheus-collector\"}[5m]) ) * on (cluster, namespace, pod) group_left(node) topk by (cluster, namespace, pod) ( 1, max by(cluster, namespace, pod, node) (kube_pod_info{job=\"kube-state-metrics\",node!=\"\", namespace=\"kube-system\"}) )) by (container, pod) *100 > 75",
"for": "PT3M",
"annotations": {
"description": "CPU usage greater than 75% for prometheus-collector on cluster ci-dev-aks-mac-eus"
Expand All @@ -218,7 +218,7 @@
},
{
"alert": "Memory usage % greater than 75 for prometheus-collector containers on cluster ci-dev-aks-mac-eus",
"expression": "(sum(container_memory_working_set_bytes{namespace=\"kube-system\", container=\"prometheus-collector\", image!=\"\"}) by (container, pod) / sum(kube_pod_container_resource_limits{namespace=\"kube-system\", container=\"prometheus-collector\", resource=\"memory\"}) by (container, pod)) * 100> 75",
"expression": "(sum(container_memory_working_set_bytes{job=\"cadvisor\",namespace=\"kube-system\", container=\"prometheus-collector\", image!=\"\"}) by (container, pod) / sum(kube_pod_container_resource_limits{job=\"kube-state-metrics\",namespace=\"kube-system\", container=\"prometheus-collector\", resource=\"memory\"}) by (container, pod)) * 100> 75",
"for": "PT3M",
"annotations": {
"description": "Memory usage greater than 75% for prometheus-collector containers on cluster ci-dev-aks-mac-eus"
Expand Down Expand Up @@ -254,7 +254,7 @@
},
{
"alert": "New agent version found for prometheus collector",
"expression": "count(count (kube_pod_container_info{image=~\"mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector.*\"}) by (image)) > 4",
"expression": "count(count (kube_pod_container_info{job=\"kube-state-metrics\",image=~\"mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector.*\"}) by (image)) > 4",
"for": "PT60S",
"annotations": {
"description": "New agent version found for prometheus collector. This alert is only used in near ring regions for prod monitoring clusters"
Expand Down