-
Notifications
You must be signed in to change notification settings - Fork 9
/
api.example.yml
292 lines (289 loc) · 13.2 KB
/
api.example.yml
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# Redis configuration depends on fields specified in redis config section:
# 1. Use field `master_name` to enable Redis Sentinel support
# 2. Specify two or more `addrs` to enable cluster support
# 3. Otherwise, standalone configuration is enabled
redis:
# Sentinel master name
master_name: ""
# address list, format: {host1_name:port},{ip:port}
addrs: "localhost:6379"
# Redis username
username: "username"
# Redis password
password: "password"
# Redis Sentinel username
sentinel_username: "sentinel_username"
# Redis Sentinel password
sentinel_password: "sentinel_password"
# Moira will delete metrics older than this value from Redis. Large values will lead to various problems everywhere.
# See https://github.com/moira-alert/moira/pull/519
metrics_ttl: 3h
# Dial timeout for establishing new connections
# Default is 500 milliseconds
dial_timeout: 1s
# Timeout for socket reads. If reached, commands will fail
# with a timeout instead of blocking. Default is 3 seconds.
# Skip this setting or set 0 for default.
read_timeout: 5s
# Timeout for socket writes. If reached, commands will fail
# with a timeout instead of blocking. Default is ReadTimeout.
# Skip this setting or set 0 for default.
write_timeout: 5s
# Enables read-only commands on slave nodes
# The flag does not work without `route_randomly` or `route_by_latency` set to true
read_only: true
# Allows routing read-only commands to the **random** master or slave node
# It automatically enables ReadOnly
route_randomly: true
# Allows routing read-only commands to the **closest** master or slave node
# It automatically enables ReadOnly
route_by_latency: false
# Minimum backoff between retries. Used to calculate exponential backoff. Default value is 0
min_retry_backoff: 1s
# Maximum backoff between retries. Used to calculate exponential backoff. Default value is 0
max_retry_backoff: 10s
# Max amount of attempts to find alive node (in Redis cluster)
max_redirects: 4
telemetry:
# Common port for all telemetry data: Prometheus scraping, pprof, etc.
listen: ":8091"
pprof:
# If true, pprof will be enabled on common telemetry port.
enabled: false
graphite:
# If true, graphite sender will be enabled.
enabled: true
# If true, runtime stats will be captured and sent to graphite. Note: It takes to call stoptheworld() with configured "graphite.interval" to capture runtime stats (https://golang.org/src/runtime/mstats.go)
runtime_stats: false
# Graphite relay URI, format: ip:port
uri: "graphite-relay:2003"
# Moira metrics prefix. Use 'prefix: {hostname}' to use hostname autoresolver.
prefix: DevOps.moira
# Metrics sending interval
interval: 60s
api:
# Api local network address. Default is ':8081' so api will be available at http://moira.company.com:8081/api
listen: ":8081"
# If true, CORS for cross-domain requests will be enabled. This option can be used only for debugging purposes.
enable_cors: false
# Web_UI config file path. If file not found, api will return 404 in response to "api/config"
web_config_path: "/etc/moira/web.json"
# Configuration of user roles
authorization:
# If disabled (default), every use has access to every resource (except for subscriptions and contacts, which are only available for their owners)
# If enabled, some resources are limited to admins-only, and admins have access to users' subscriptions and contacts
enabled: true
# List of users who have admin rights
# User login is extracted from `x-webauth-user` header`
admin_list:
- alice
- bob
# Configurable limits to some Moira entities
limits:
# Limits applied to trigger
trigger:
# Max amount of characters allowed in trigger name
# We do not recommend to greatly increase this limit because it can cause failures on sending alerts
max_name_size: 200
# Limits applied to team
team:
# Max amount of characters allowed in team name
max_name_size: 100
# Max amount of characters allowed in team description
max_description_size: 1000
web:
# Moira administrator email address
supportEmail: "[email protected]"
# List of enabled contact types
contacts_template:
- type: mail
# logo_uri is an optional field that specifies the path to the file with the contact's logo
# If you do not specify a value for this field, the default logo option will be selected
# All logos are stored in the web2.0 repository, the value can be one of: [discord-logo.svg, facebook-logo.svg, mail-logo.svg, mattermost-logo.svg, msteams-logo.svg, opsgenie-logo.svg,
# pagerduty-logo.svg, phone-logo.svg, pushover-logo.svg, slack-logo.svg, telegram-logo.svg, twilio-logo.svg, twitter-logo.svg, viber-logo.svg, victorops-logo.svg,
# webhook-logo.svg, whatsapp-logo.svg, sms-logo.svg]
logo_uri: mail-logo.svg
label: E-mail
validation: "^.+@.+\\..+$"
- type: msteams
logo_uri: msteams-logo.svg
label: Microsoft Teams
- type: pushover
logo_uri: pushover-logo.svg
label: Pushover
placeholder: "Pushover user key"
- type: slack
logo_uri: slack-logo.svg
label: Slack
validation: "^[@#][a-zA-Z0-9-_]+"
placeholder: "Slack #channel or @user"
- type: telegram
logo_uri: telegram-logo.svg
label: Telegram
placeholder: "#public_channel, %private_channel, @username or group"
help: |
### To make things work you should:
### In personal chat:
- start conversation with bot [@YourMoiraBot](https://t.me/YourMoiraBot);
- execute command `/start`;
- type your login in above field as `@login`.
### In group chat (with or without topics):
- invite bot [@YourMoiraBot](https://t.me/YourMoiraBot) into chat;
- execute command `/start@YourMoiraBot`;
- bot will send you chat name, you should type it without extra characters in above field.
### In public channel:
- add bot [@YourMoiraBot](https://t.me/YourMoiraBot) into channel;
- promote bot as channel administrator;
- type channel name in above field as `#channel`.
### In private channel:
- add bot [@YourMoiraBot](https://t.me/YourMoiraBot) into the channel;
- promote bot as channel administrator;
- open your private channel on the [web](https://web.telegram.org/#/im);
- get channel id from URL (e.g., `https://web.telegram.org/#/im?p=c1494975744_17340166617136722341`) between `c` and `_`;
- type channel id in the above field as `%1494975744`.
- type: twilio sms
logo_uri: twilio-logo.svg
label: Twilio SMS
validation: "^\\+79\\d{9}$"
placeholder: "Phone number format +79*********"
- type: twilio voice
logo_uri: twilio-logo.svg
label: Twilio voice
validation: "^\\+79\\d{9}$"
placeholder: "Phone number format +79*********"
- type: webhook
logo_uri: webhook-logo.svg
label: My Webhook
validation: "^(http|https):\\/\\/.*(example.com|example.org)(:[0-9]{2,5})?\\/"
placeholder: "https://example.com/webhooks/moira"
help: "### Domains whitelist:\n - example.com\n - example.org"
- type: pagerduty
logo_uri: pagerduty-logo.svg
label: PagerDuty
placeholder: "Integration key"
- type: opsgenie
logo_uri: opsgenie-logo.svg
label: OpsGenie
placeholder: "Responder Name or ID"
- type: victorops
logo_uri: victorops-logo.svg
label: VictorOps
placeholder: "Routing key"
- type: discord
logo_uri: discord-logo.svg
label: Discord
placeholder: "Discord channel (eg: general-text) or user (eg: @user)"
# Feature flags settings
feature_flags:
# Sets whether sending graphics in subscriptions is enabled by default
is_plotting_default_on: true
# Sets whether sending graphics is available
is_plotting_available: true
# Sets whether it is allowed to create subscriptions to all tags
is_subscription_to_all_tags_available: true
# Sets the readonly mode in the Moira, which disables state-changing requests
is_readonly_enabled: false
# Sets special celebration theme in Moira. Default "", which means no celebration modes.
# Now available one of: [new_year]
celebration_mode: new_year
# sentry sets sentry settings for the frontend
sentry:
# Sets the dsn key
dsn: https://[email protected]/
# Sets the platform where the frontend is deployed
platform: prod
log:
log_file: stdout
log_level: info
# This section configures the list of graphite remote triggers sources.
# See https://moira.readthedocs.io/en/latest/installation/configuration.html#graphite-remote-triggers-checker for further information
# Used to be `remote` and contain only one source before v2.10
graphite_remote:
- # Unique cluster id (no other graphite_remote cluster should have the same one)
# Use `default` for compatibility with old triggers without cluster_id
# Should not be changed if there are any triggers using it
cluster_id: default
# Cluster name to be displayed in UI
cluster_name: Graphite Remote
# URL of Graphite HTTP API: graphite-web, carbonapi, etc.
# Specify full URL including '/render'
url: "http://graphite.example.com/render"
# Auth username. Only Basic-auth supported
user: graphite_admin
# Auth password. Only Basic-auth supported
password: verySecurePassword
# Minimal period to perform triggers re-check.
# Note: Reducing of this value leads to increasing of CPU and memory usage values and extra load on Graphite HTTP API
check_interval: 60s
# Don't fetch metrics older than this value from remote storage
metrics_ttl: 168h
# Maximum timeout for HTTP-request made to Graphite HTTP API
timeout: 60s
# From 2.14.0
# Retries configuration for requests, that fetch data.
# Library used for calculating exponential backoff retries: https://pkg.go.dev/github.com/cenkalti/backoff/v4
retries:
# Initial interval for retry attempt
initial_interval: 60s
# Used to calc interval between retries: RandomizedRetryInterval = RetryInterval *
# * (random value from range [1 - randomization_factor, 1 + randomization_factor])
randomization_factor: 0.5
# For calculating next: RetryInterval = RetryInterval * multiplier
multiplier: 1.5
# Caps RetryInterval (NOT RandomizedRetryInterval)
max_interval: 120s
# If already max_retries_count retries performed, stop retrying.
# At least one of (max_retries_count, max_elapsed_time) should be specified
max_retries_count: 3
# If time passed since first try is more than max_elapsed_time than stop retrying.
# At least one of (max_retries_count, max_elapsed_time) should be specified
max_elapsed_time: 360s
# From 2.14.0
# Maximum timeout for healthcheck requests
heathcheck_timeout: 60s
# From 2.14.0
# Retries configuration for healthcheck requests (same fields as for retries)
heathcheck_retries:
# Initial interval for retry attempt
initial_interval: 10s
# Used to calc interval between retries: RandomizedRetryInterval = RetryInterval *
# * (random value from range [1 - randomization_factor, 1 + randomization_factor])
randomization_factor: 0.5
# For calculating next: RetryInterval = RetryInterval * multiplier
multiplier: 1.5
# Caps RetryInterval (NOT RandomizedRetryInterval)
max_interval: 60s
# If already max_retries_count retries performed, stop retrying.
# At least one of (max_retries_count, max_elapsed_time) should be specified
max_retries_count: 3
# If time passed since first try is more than max_elapsed_time than stop retrying
# At least one of (max_retries_count, max_elapsed_time) should be specified
max_elapsed_time: 200s
# This section configures the list of prometheus remote triggers sources.
# See https://moira.readthedocs.io/en/latest/installation/configuration.html#prometheus-remote-triggers-checker for further information
# Used to be `prometheus` and contain only one source before v2.10
prometheus_remote:
- # Unique cluster id (no other prometheus_remote cluster should have the same one)
# Use `default` for compatibility with old triggers without cluster_id
# Should not be changed if there are any triggers using it
cluster_id: default
# Cluster name to be displayed in UI
cluster_name: Prometheus Remote
# URL of Prometheus HTTP API: Prometheus or VMSelect
# Only domain name must be specified, no URL-path
url: https://prometheus.example.com
# Auth username. Only Basic-auth supported
user: prometheus_admin
# Auth password. Only Basic-auth supported
password: verySecurePassword
# Minimal period to perform triggers re-check.
# Note: Reducing of this value leads to increasing of CPU and memory usage values and extra load on Prometheus HTTP API
check_interval: "60s"
# Maximum timeout for HTTP-request made to Prometheus HTTP API
timeout: "10s"
# Number of times failed request should be retried
retries: 3
# Delay between retries
retry_timeout: "3s"
# Don't fetch metrics older than this value from remote storage
metrics_ttl: "168h"