|
2 | 2 | prometheusAlerts+:: {
|
3 | 3 | groups+: [
|
4 | 4 | {
|
5 |
| - name: 'opensearch', |
| 5 | + name: $._config.uid + '-alerts', |
6 | 6 | rules: [
|
7 | 7 | {
|
8 | 8 | alert: 'OpenSearchYellowCluster',
|
9 | 9 | expr: |||
|
10 |
| - opensearch_cluster_status == 1 |
| 10 | + opensearch_cluster_status{%(filteringSelector)s} == 1 |
11 | 11 | ||| % $._config,
|
12 | 12 | 'for': '5m',
|
13 | 13 | labels: {
|
|
24 | 24 | {
|
25 | 25 | alert: 'OpenSearchRedCluster',
|
26 | 26 | expr: |||
|
27 |
| - opensearch_cluster_status == 2 |
| 27 | + opensearch_cluster_status{%(filteringSelector)s} == 2 |
28 | 28 | ||| % $._config,
|
29 | 29 | 'for': '5m',
|
30 | 30 | labels: {
|
|
41 | 41 | {
|
42 | 42 | alert: 'OpenSearchUnstableShardReallocation',
|
43 | 43 | expr: |||
|
44 |
| - sum without(type) (opensearch_cluster_shards_number{type="relocating"}) > %(alertsWarningShardReallocations)s |
| 44 | + sum without(type) (opensearch_cluster_shards_number{%(filteringSelector)s, type="relocating"}) > %(alertsWarningShardReallocations)s |
45 | 45 | ||| % $._config,
|
46 | 46 | 'for': '1m',
|
47 | 47 | labels: {
|
|
57 | 57 | {
|
58 | 58 | alert: 'OpenSearchUnstableShardUnassigned',
|
59 | 59 | expr: |||
|
60 |
| - sum without(type) (opensearch_cluster_shards_number{type="unassigned"}) > %(alertsWarningShardUnassigned)s |
| 60 | + sum without(type) (opensearch_cluster_shards_number{%(filteringSelector)s, type="unassigned"}) > %(alertsWarningShardUnassigned)s |
61 | 61 | ||| % $._config,
|
62 | 62 | 'for': '5m',
|
63 | 63 | labels: {
|
|
73 | 73 | {
|
74 | 74 | alert: 'OpenSearchModerateNodeDiskUsage',
|
75 | 75 | expr: |||
|
76 |
| - 100 * sum without(nodeid, path, mount, type) ((opensearch_fs_path_total_bytes - opensearch_fs_path_free_bytes) / opensearch_fs_path_total_bytes) > %(alertsWarningDiskUsage)s |
| 76 | + 100 * sum without(nodeid, path, mount, type) ((opensearch_fs_path_total_bytes{%(filteringSelector)s} - opensearch_fs_path_free_bytes{%(filteringSelector)s}) / opensearch_fs_path_total_bytes{%(filteringSelector)s}) > %(alertsWarningDiskUsage)s |
77 | 77 | ||| % $._config,
|
78 | 78 | 'for': '5m',
|
79 | 79 | labels: {
|
|
89 | 89 | {
|
90 | 90 | alert: 'OpenSearchHighNodeDiskUsage',
|
91 | 91 | expr: |||
|
92 |
| - 100 * sum without(nodeid, path, mount, type) ((opensearch_fs_path_total_bytes - opensearch_fs_path_free_bytes) / opensearch_fs_path_total_bytes) > %(alertsCriticalDiskUsage)s |
| 92 | + 100 * sum without(nodeid, path, mount, type) ((opensearch_fs_path_total_bytes{%(filteringSelector)s} - opensearch_fs_path_free_bytes) / opensearch_fs_path_total_bytes{%(filteringSelector)s}) > %(alertsCriticalDiskUsage)s |
93 | 93 | ||| % $._config,
|
94 | 94 | 'for': '5m',
|
95 | 95 | labels: {
|
|
105 | 105 | {
|
106 | 106 | alert: 'OpenSearchModerateNodeCpuUsage',
|
107 | 107 | expr: |||
|
108 |
| - sum without(nodeid) (opensearch_os_cpu_percent) > %(alertsWarningCPUUsage)s |
| 108 | + sum without(nodeid) (opensearch_os_cpu_percent{%(filteringSelector)s}) > %(alertsWarningCPUUsage)s |
109 | 109 | ||| % $._config,
|
110 | 110 | 'for': '5m',
|
111 | 111 | labels: {
|
|
121 | 121 | {
|
122 | 122 | alert: 'OpenSearchHighNodeCpuUsage',
|
123 | 123 | expr: |||
|
124 |
| - sum without(nodeid) (opensearch_os_cpu_percent) > %(alertsCriticalCPUUsage)s |
| 124 | + sum without(nodeid) (opensearch_os_cpu_percent{%(filteringSelector)s}) > %(alertsCriticalCPUUsage)s |
125 | 125 | ||| % $._config,
|
126 | 126 | 'for': '5m',
|
127 | 127 | labels: {
|
|
137 | 137 | {
|
138 | 138 | alert: 'OpenSearchModerateNodeMemoryUsage',
|
139 | 139 | expr: |||
|
140 |
| - sum without(nodeid) (opensearch_os_mem_used_percent) > %(alertsWarningMemoryUsage)s |
| 140 | + sum without(nodeid) (opensearch_os_mem_used_percent{%(filteringSelector)s}) > %(alertsWarningMemoryUsage)s |
141 | 141 | ||| % $._config,
|
142 | 142 | 'for': '5m',
|
143 | 143 | labels: {
|
|
153 | 153 | {
|
154 | 154 | alert: 'OpenSearchHighNodeMemoryUsage',
|
155 | 155 | expr: |||
|
156 |
| - sum without(nodeid) (opensearch_os_mem_used_percent) > %(alertsCriticalMemoryUsage)s |
| 156 | + sum without(nodeid) (opensearch_os_mem_used_percent{%(filteringSelector)s}) > %(alertsCriticalMemoryUsage)s |
157 | 157 | ||| % $._config,
|
158 | 158 | 'for': '5m',
|
159 | 159 | labels: {
|
|
169 | 169 | {
|
170 | 170 | alert: 'OpenSearchModerateRequestLatency',
|
171 | 171 | expr: |||
|
172 |
| - sum without(context) ((increase(opensearch_index_search_fetch_time_seconds{context="total"}[5m])+increase(opensearch_index_search_query_time_seconds{context="total"}[5m])+increase(opensearch_index_search_scroll_time_seconds{context="total"}[5m])) / clamp_min(increase(opensearch_index_search_fetch_count{context="total"}[5m])+increase(opensearch_index_search_query_count{context="total"}[5m])+increase(opensearch_index_search_scroll_count{context="total"}[5m]), 1)) > %(alertsWarningRequestLatency)s |
| 172 | + sum without(context) ((increase(opensearch_index_search_fetch_time_seconds{%(filteringSelector)s, context="total"}[5m])+increase(opensearch_index_search_query_time_seconds{context="total"}[5m])+increase(opensearch_index_search_scroll_time_seconds{context="total"}[5m])) / clamp_min(increase(opensearch_index_search_fetch_count{context="total"}[5m])+increase(opensearch_index_search_query_count{context="total"}[5m])+increase(opensearch_index_search_scroll_count{context="total"}[5m]), 1)) > %(alertsWarningRequestLatency)s |
173 | 173 | ||| % $._config,
|
174 | 174 | 'for': '5m',
|
175 | 175 | labels: {
|
|
185 | 185 | {
|
186 | 186 | alert: 'OpenSearchModerateIndexLatency',
|
187 | 187 | expr: |||
|
188 |
| - sum without(context) (increase(opensearch_index_indexing_index_time_seconds{context="total"}[5m]) / clamp_min(increase(opensearch_index_indexing_index_count{context="total"}[5m]), 1)) > %(alertsWarningIndexLatency)s |
| 188 | + sum without(context) (increase(opensearch_index_indexing_index_time_seconds{%(filteringSelector)s, context="total"}[5m]) / clamp_min(increase(opensearch_index_indexing_index_count{context="total"}[5m]), 1)) > %(alertsWarningIndexLatency)s |
189 | 189 | ||| % $._config,
|
190 | 190 | 'for': '5m',
|
191 | 191 | labels: {
|
|
0 commit comments