Skip to content

Commit 19459d8

Browse files
authored
added alertmanager-config example, added value attributes (grafana#181)
Signed-off-by: Raphael Grömmer <r.groemmer@yahoo.de>
1 parent cff890e commit 19459d8

File tree

1 file changed

+50
-12
lines changed

1 file changed

+50
-12
lines changed

README.md

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,19 @@ alertmanager:
9090
```
9191
And here are the related configuration values in AlertManager and Ruler:
9292
```yaml
93-
alertmanager:
94-
data_dir: /data/
95-
storage:
96-
type : local
97-
local:
98-
path: /data
99-
ruler:
100-
rule_path: /data/rules
101-
storage:
102-
type : local
103-
local:
104-
directory: /tmp/rules
93+
config:
94+
alertmanager:
95+
data_dir: /data/
96+
storage:
97+
type : local
98+
local:
99+
path: /data
100+
ruler:
101+
rule_path: /data/rules
102+
storage:
103+
type : local
104+
local:
105+
directory: /tmp/rules
105106
```
106107
In AlertManager, the data_dir and local storage directory should be the same.
107108
In the Ruler, there needs to be two separate volumes. One is read-only and serves as the location shared with the sidecar that contains all of the rules that were derived from configmaps (/tmp/rules). The other is read-write and used by the Ruler itself for its own management of rules, etc (/data).
@@ -132,6 +133,39 @@ data:
132133
title: Node {{ $labels.instance }} has high CPU usage
133134
134135
```
136+
Example ConfigMap containing an alertmanager-config:
137+
```yaml
138+
apiVersion: v1
139+
kind: ConfigMap
140+
metadata:
141+
annotations:
142+
k8s-sidecar-target-directory: /data/fake
143+
labels:
144+
cortex_alertmanager: "1"
145+
name: alertmanager-example-config
146+
data:
147+
fake.yaml: |-
148+
global:
149+
resolve_timeout: 5m
150+
http_config: {}
151+
smtp_hello: localhost
152+
smtp_require_tls: true
153+
route:
154+
receiver: team-X-mails
155+
group_by:
156+
- alertname
157+
routes:
158+
- receiver: "null"
159+
match:
160+
alertname: Watchdog
161+
group_wait: 30s
162+
group_interval: 5m
163+
repeat_interval: 12h
164+
receivers:
165+
- name: 'team-X-mails'
166+
email_configs:
167+
- to: 'team-X+alerts@example.org'
168+
```
135169
136170
## Requirements
137171
@@ -263,6 +297,8 @@ Kubernetes: `^1.19.0-0`
263297
| compactor.terminationGracePeriodSeconds | int | `240` | |
264298
| compactor.tolerations | list | `[]` | |
265299
| config.alertmanager.external_url | string | `"/api/prom/alertmanager"` | |
300+
| config.alertmanager.enable_api | bool | `false` | Enable the experimental alertmanager config api. |
301+
| config.alertmanager.storage | object | {} | Type of backend to use to store alertmanager configs. Supported values are: "configdb", "gcs", "s3", "local". refer to: https://cortexmetrics.io/docs/configuration/configuration-file/#alertmanager_config |
266302
| config.api.prometheus_http_prefix | string | `"/prometheus"` | |
267303
| config.api.response_compression_enabled | bool | `true` | |
268304
| config.auth_enabled | bool | `false` | |
@@ -297,6 +333,8 @@ Kubernetes: `^1.19.0-0`
297333
| config.query_range.results_cache.cache.memcached_client.timeout | string | `"1s"` | |
298334
| config.query_range.split_queries_by_interval | string | `"24h"` | |
299335
| config.ruler.enable_alertmanager_discovery | bool | `false` | |
336+
| config.ruler.enable_api | bool | `false` | Enable the experimental ruler config api. |
337+
| config.ruler.storage | object | {} | Method to use for backend rule storage (configdb, azure, gcs, s3, swift, local) refer to https://cortexmetrics.io/docs/configuration/configuration-file/#ruler_config|
300338
| config.schema.configs[0].chunks.period | string | `"168h"` | |
301339
| config.schema.configs[0].chunks.prefix | string | `"chunks_"` | |
302340
| config.schema.configs[0].from | string | `"2020-11-01"` | |

0 commit comments

Comments
 (0)