Configuration¶
By default, microservices will look for /etc/moira/<servicename>.yml
, but you can change this location
by passing your path as a command-line parameter --config
.
On this page you can find examples of configuration files for Moira microservices.
Filter¶
# Use fields MasterName and SentinelAddrs to enable Redis Sentinel support,
# use Host and Port fields otherwise.
redis:
# Sentinel cluster name
master_name: ""
# Sentinel address list, format: {host1_name:port};{ip:port}
sentinel_addrs: ""
# Node ip-address or host name
host: "moira-redis"
# Node port
port: "6379"
# Database id
dbid: 0
graphite:
# If true, graphite logger will be enabled
enabled: true
# Graphite relay URI
uri: "graphite-relay:2003"
# Moira metrics prefix. Use 'prefix: {hostname}' to use hostname autoresolver.
prefix: DevOps.moira
# Metrics sending interval
interval: 60s
filter:
# Metrics listener uri
listen: ":2003"
# Retentions config file path. Simply use your original storage-schemas.conf or create new if you're using Moira without existing Graphite installation.
retention-config: /etc/moira/storage-schemas.conf
log:
log_file: stdout
log_level: info
storage-schemas.conf is graphite carbon configuration file that should match similarly-named file in your Graphite installation.
Checker¶
redis:
host: "moira-redis"
port: "6379"
dbid: 0
graphite:
enabled: true
uri: "graphite-relay:2003"
prefix: DevOps.moira
interval: 60s
checker:
# Period for every trigger to perform forced check on
nodata_check_interval: 60s
# Min period to perform triggers re-check. Note: Reducing of this value leads to increasing of CPU and memory usage values
check_interval: 10s
# Time interval to store metrics. Note: Increasing of this value leads to increasing of Redis memory consumption value
metrics_ttl: 3h
# Period for every trigger to cancel forced check (greater than 'NoDataCheckInterval') if no metrics were received
stop_checking_interval: 30s
# Equals to the number of processor cores found on Moira host by default or when variable is defined as 0.
max_parallel_checks: 0
log:
log_file: stdout
log_level: info
Notifier¶
redis:
host: "moira-redis"
port: "6379"
dbid: 0
graphite:
enabled: true
uri: "graphite-relay:2003"
prefix: DevOps.moira
interval: 60s
notifier:
# Soft timeout to start retrying to send notification after single failed attempt
sender_timeout: 10s
# Hard timeout to stop retrying to send notification after multiple failed attempts
resending_timeout: "1:00"
# Web-UI uri prefix for trigger links in notifications. For example: with 'http://localhost' every notification will contain link like 'http://localhost/trigger/triggerId'
front_uri: "https://moira.example.com"
# Timezone to use to convert ticks. Default is UTC. See https://golang.org/pkg/time/#LoadLocation for more details.
timezone: Europe/Moscow
# List of senders, every element has "type" field (one of ["pushover", "slack", "mail", "telegram", "twilio sms", "twilio voice", "script"])
# Every type of sender has additional config fields
senders:
- type: pushover
# Api token for your pushover channel, for more info see https://pushover.net/api#registration
api_token: ...
- type: slack
# Api token for your moira notifications slack user, for more info see https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens
api_token: ...
- type: telegram
# Api token for your telegram bot, for more info about creating bot and get token see https://core.telegram.org/bots#3-how-do-i-create-a-bot
api_token: ...
- type: mail
mail_from: ...
smtp_host: ...
smtp_port: ...
# Skip SMTP server certificate chain validation if false
insecure_tls: false
# Uses "mail_from" if empty
smtp_user: ...
smtp_pass: ...
# Email template file path (standard Go templates), if empty use default template
template_file: ...
- type: twilio sms
api_asid: ...
api_authtoken: ...
api_fromphone: ...
# URL that responds with TwiML config for voice message generation, see https://www.twilio.com/docs/api/twiml/voice-overview
voiceurl: ...
append_message: true
- type: twilio voice
api_asid: ...
api_authtoken: ...
api_fromphone: ...
- type: script
name: ...
# Executable path. File must exist on all machines where notifier is running.
# You can use ${trigger_name} and ${contact_value} in command-line parameters,
# they will be replaced with trigger name and contact (as specified in web interface).
exec: ...
# Self state monitor configuration section. Note: No inner subscriptions is required. It's own notification mechanism will be used.
moira_selfstate:
enabled: true
# Max Redis disconnect delay to send alert when reached
redis_disconect_delay: 60s
# Max Filter metrics receive delay to send alert when reached
last_metric_received_delay: 120s
# Max Checker checks perform delay to send alert when reached
last_check_delay: 120s
# Self state monitor alerting interval
notice_interval: 300s
# Contact list for Self state monitor alerts, use this like delivery channels in web-ui
contacts:
- type: mail
value: devopsteam@example.com
log:
log_file: stdout
log_level: info
API¶
redis:
host: "moira-redis"
port: "6379"
dbid: 0
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"
log:
log_file: stdout
log_level: info
UI¶
{
"contacts": [
{"type": "pushover", "validation": ""},
{"type": "slack", "validation": "^[@#].+$"},
{"type": "telegram", "validation": "", "title": "#channel, @username, group", "help": "required to grant @ExampleMoiraBot admin privileges for channels, or /start command in groups and personal chats"},
],
"supportEmail": "devops@example.com"
}