-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathalerts.yaml
More file actions
153 lines (139 loc) · 6.47 KB
/
Copy pathalerts.yaml
File metadata and controls
153 lines (139 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Prometheus alerting rules for self-hosted Oz agent workers.
#
# Usage:
# - Vanilla Prometheus: place this file in your Prometheus rules directory
# and reference it from prometheus.yml under `rule_files:`.
# - Prometheus Operator: wrap the `groups` block in a PrometheusRule CRD
# (apiVersion: monitoring.coreos.com/v1, kind: PrometheusRule).
#
# All thresholds are conservative starting points. Tune them for your fleet
# size, task volume, and SLOs before enabling in production.
groups:
- name: oz_agent_worker
interval: 60s
rules:
# ── Connectivity ──────────────────────────────────────────────────────
- alert: OzWorkerDisconnected
expr: |
oz_worker_connected == 0
for: 2m
labels:
severity: warning
annotations:
summary: "Oz worker {{ $labels.instance }} has lost its connection to Oz"
description: >
Worker {{ $labels.instance }} has reported oz_worker_connected=0 for
more than 2 minutes. The worker is no longer accepting tasks.
Check network egress to oz.warp.dev and review worker logs.
- alert: OzWorkerReconnectStorm
expr: |
sum by (instance) (rate(oz_worker_websocket_reconnects_total[5m])) > 0.1
for: 5m
labels:
severity: warning
annotations:
summary: "Oz worker {{ $labels.instance }} is reconnecting frequently"
description: >
Worker {{ $labels.instance }} is reconnecting to warp-server at a rate
of {{ $value | humanize }}/s (threshold: 0.1/s). This may indicate
network instability, TLS issues, or server-side disruptions.
# ── Capacity ──────────────────────────────────────────────────────────
- alert: OzWorkerFleetSaturated
expr: |
(
sum(oz_worker_tasks_active) /
sum(oz_worker_tasks_max_concurrent != 0)
) > 0.9
for: 5m
labels:
severity: warning
annotations:
summary: "Oz worker fleet is running at high capacity"
description: >
The fleet is using {{ $value | humanizePercentage }} of configured
concurrency capacity (threshold: 90%). Tasks may start experiencing
rejections. Consider increasing max_concurrent_tasks or deploying
additional worker instances.
runbook: |
1. Check oz_worker_tasks_rejected_total for recent rejections.
2. Review oz_worker_task_duration_seconds to see if tasks are running longer than expected.
3. Increase max_concurrent_tasks in worker config, or deploy more worker pods.
- alert: OzWorkerTasksRejected
expr: |
sum(rate(oz_worker_tasks_rejected_total[5m])) > 0
for: 1m
labels:
severity: warning
annotations:
summary: "Oz workers are rejecting tasks"
description: >
Workers are rejecting tasks at {{ $value | humanize }}/s. Rejections
occur when a worker is at its concurrency limit (max_concurrent_tasks).
Increase capacity or the concurrency limit to stop dropping tasks.
# ── Task failures ─────────────────────────────────────────────────────
- alert: OzWorkerHighFailureRate
expr: |
(
sum(rate(oz_worker_tasks_completed_total{result="failed"}[5m])) /
sum(rate(oz_worker_tasks_completed_total[5m]))
) > 0.1
for: 5m
labels:
severity: warning
annotations:
summary: "Oz worker task failure rate is elevated"
description: >
{{ $value | humanizePercentage }} of completed tasks have failed over
the last 5 minutes (threshold: 10%). Check
oz_worker_task_failures_total{phase,reason} for the root cause.
- alert: OzWorkerImagePullFailures
expr: |
sum(rate(oz_worker_task_failures_total{reason="image_pull"}[5m])) > 0
for: 2m
labels:
severity: warning
annotations:
summary: "Oz worker is failing to pull task images"
description: >
Workers are failing to pull container images at
{{ $value | humanize }}/s. Check image registry access, pull secrets,
and image availability. For Kubernetes, confirm imagePullSecrets are
configured and the registry is reachable from the cluster.
- alert: OzWorkerContainerOOM
expr: |
sum(rate(oz_worker_task_failures_total{reason="container_oom"}[5m])) > 0
for: 2m
labels:
severity: warning
annotations:
summary: "Oz worker task containers are being OOM-killed"
description: >
Task containers are being killed due to memory limits at
{{ $value | humanize }}/s. Review the memory limits set in
pod_template or the instance shape for the runs that are failing,
and increase them if tasks require more memory.
- alert: OzWorkerUnschedulablePods
expr: |
sum(rate(oz_worker_task_failures_total{reason="unschedulable"}[5m])) > 0
for: 5m
labels:
severity: warning
annotations:
summary: "Oz worker task pods are failing to schedule"
description: >
Kubernetes task pods are becoming unschedulable at
{{ $value | humanize }}/s. Check node capacity, taints, tolerations,
resource requests in pod_template, and cluster autoscaler status.
# ── No workers connected ──────────────────────────────────────────────
- alert: OzWorkerFleetEmpty
expr: |
sum(oz_worker_connected) == 0
for: 5m
labels:
severity: critical
annotations:
summary: "No Oz workers are connected"
description: >
No workers have an active connection to Oz. Cloud agent tasks cannot
be dispatched to self-hosted infrastructure. Check worker pod
readiness, API key validity, and network egress to oz.warp.dev.